The following example convert a comma separated string into an array.
public class StringToArrayDemo {
public static void main(String[] args) {
String s = "ykyuen,wordpress,com";
String[] values = data.split(",");
for (String value:values) {
System.out.println(value);
}
}
}
Done =)
Reference: Kodejava – How do I split a string?

Compilation error! Should be s.split(“,”) ? 😉
LikeLike
updated =P
LikeLike
Great work…
LikeLike
Thanks =D
LikeLike