I\'m trying to use
\"value1:value2::value3\".split(\":\");
Problem is that I want it to include the blank results.
It returns:
Works for me.
class t {
public static void main(String[] _) {
String t1 = "value1:value2::value3";
String[] t2 = t1.split(":");
System.out.println("t2 has "+t2.length+" elements");
for (String tt : t2) System.out.println("\""+tt+"\"");
}
}
gives the output
$ java t
t2 has 4 elements
"value1"
"value2"
""
"value3"