-
Split question
I'd like to know how can I split a string with tabs as delimiters
I tried the following code
string inputString = "0\t100\t-5\t300\t500"; \\ \t are tabs
string delimStr ="\t";
char [] delimiter = delimStr.ToCharArray();
string [] split = input.Split(delimiter, x);
at this point, I expected the split array to contain the numbers separately (0, 100, -5, 300, and 500)
but instead the array only contains one element that is 0\t100\t-5\t300\t500
Any tips on this?
-
Re: Split question
-
Re: Split question
Hmm it's still not working
Am I missing something here?
Code:
string delimStr ="\\t";
-
Re: Split question
this works for me
Code:
string inputString = "0\t100\t-5\t300\t500";
char delimStr ='\t';
string[] split = inputString.Split(delimStr);
-
Re: Split question
:thumb: :thumb: :thumb:
It works
:thumb: :thumb: :thumb:
Thank you so much!!