java - Assigning occurrences of whitespace to variables -


i wondering if possible assign occurrences of characters variable until hit white space character. instance if have string "17 23 4 54 6 343 4" how assign first number 17 variable, , next subsequent numbers.

string values = "17 23 4 54 6 343 4"; string[] variables = values.split("\\s"); 

now you've got array variables holds 17 in variables[0], 23 in variables[1] , on.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -