package net.fdms.Function.Convert 
{
	/**
	 * ...
	 * @author Dawnboy
	 */
	public class StringToObject 
	{
		
		public function StringToObject() 
		{
			
		}
		public static function convert(str:String):Object {
			var foo:Object = { };
			if(str && str!=""){
				var sub_str:String = str.slice(str.indexOf("{") + 1, str.indexOf("}"));
				var eachParam:Array = sub_str.split(",");
				
				var n:int = eachParam.length;
				for (var a:int = 0; a < n; a++ ) {
					var tmp:Array = eachParam[a].split(":");
					foo[tmp[0]] = tmp[1];
				}
			}else {
				foo = undefined;
			}
			
			return foo;
		}
		
	}

}