Friday, March 31, 2017

Java: Read values from a comma separated string

String commaSprtdStr = "abc, def, ghi, xyz";
String valueAtIndex = commaSprtdStr.split(",")[index];

The index of the first value is 0

No comments:

Post a Comment