Here is a quick snippet for expose in a class a string that contains values comma-separated (eg: value1,value2,value3) as an array.
string myString; public string[] MyArray { get { if (string.IsNullOrEmpty(myString)) return new string[0]; return myString.Split(','); } set { myString = String.Join(",", value); } }
No comments:
Post a Comment