Following is the simple code to parse comma separated string into a string array.
This StringSplitOptions reduces the overhead on developers.
It trims ',' charaters (ie if any , present in the begining or end).
It removes any empty values (ie "Dinesh,,Uthayakumar").
string Name = "Dinesh,Uthayakumar,Din";
string[] fullname = Name.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
Console.Write(fullname.Length);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment