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

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -

python - PyInstaller UAC not working in onefile mode -

wso2is - WSO2 IS 5.0.0 SP1 After restart there is authentication error -