if I have this path A/B//C
I want to extract A,B,C
I was thinking about store index of /,// and extract the values based on the indexes but this create a problem for me since // does not have a single index
/ -- index(1)
/ -- index(3)
/ -- index(4)
for (int index = 0; index <= path.Length; index++)
{
if (path[index] == '/')
{
pathIndex[index] = index;
pathChar[index] = "/";
Console.WriteLine("Index {0} char{1}", pathIndex[index], pathChar[index]);
}
}
but if there is another way which would be shortest and better. I want to know
any effort will be strongly appreciated
If you dont want empty values inside
splitted, passStringSplitOptions.RemoveEmptyEntriestoString.Split.