java - Convert comma-separated string to list of variables? -
this question has answer here:
- how split string in java 29 answers
for java , in reference question how save each value in array separate variable?
if string value is:
1234,aaa,30
variables be:
var1=1234 var2=aaa var3=30
use:
string str = "1234,aaa,30"; string[] variables = str.split(","); string first = variables[0]; string second = variables[1]; string third = variables[2];
and should work
Comments
Post a Comment