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
Post a Comment