Say I have a string in a form similar to this:
"First/Second//Third/Fourth"
(notice the double slash between Second
and Third
)
I want to be able to split this string into the following substrings "First", "Second//Third", "Fourth"
. Basically, what I want is to split the string by a char (in this case /
), but not by double of that char (in this case //
). I though of this in a number of ways, but couldn't get it working.
I can use a solution in C# and/or JavaScript.
Thanks!
Edit: I would like a simple solution. I have already thought of parsing the string char by char, but that is too complicated in my real live usage.