public EcArray(string src) { string trimedbrackets = src.Trim().TrimStart('[').TrimEnd(']'); string[] arrayitems = trimedbrackets.Split(','); List <object> FinalList = new List <object>(); foreach (var arrayitem in arrayitems) { var val = PrimitivesManager.HandlePrimitive(arrayitem.Trim()); if (val is EcString) { FinalList.Add(new EcString((val as EcString).Value.ToString().Replace("NOMATH ", ""), false)); } else { FinalList.Add(val); } } this.data = FinalList.ToArray(); this.Name = "array"; //this.Value = src; }
public static Primitive HandleVar(string value, string name = "") { if (name != "") { return(PrimitivesManager.HandlePrimitive(value)); } return(PrimitivesManager.HandlePrimitive(value, name)); }