c# - Delim Tabs in a string -


string s = "    1    16    34"; string[] words = s.split('\t'); foreach (string word in words) {    console.writeline(word); } 

i have string format shown above, when try deliminate using escape tab, outputs exact same string in original format, why not removing tabs?

    string[] words = s.split(new[] { ' ', '\t' }, stringsplitoptions.removeemptyentries);                 foreach (string word in words)                 {                     console.writeline(word);                 } 

i think fixed it.

it gives me output.

1

16

34

which checked outputting 3 in array make sure separated.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -