string[] ssss = "1,2,,3".Split(new[] {','}).Where(a=>!string.IsNullOrEmpty(a)).Select()
How does this works?
string[] ssss = "1,2,,3".Split(new[] {','}).Where(a=>!string.IsNullOrEmpty(a)).Select()
How does this works?
string[] ssss = "1,2,,3".Split(new [] {','}, StringSplitOptions.RemoveEmptyEntries);
You could also use
"1,2,,3".Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
var ssss = "1,2,,3".Split(new[] {','}).Where(a=>!string.IsNullOrEmpty(a));
foreach (string s in ssss)
{
Console.WriteLine(s);
}
string[] ssss = "1,2,,3".Split(new[] {','}).Where(a=>!string.IsNullOrEmpty(a)).ToArray();