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