Here, a regular expression method is used.
public static void main (String[] args) { String s = "\"100\",\"this, is\",\"a\",\"test\""; String arr[] = s.split(Pattern.quote("\"\\w\""))); System.out.println(Arrays.toString(arr)); }
Output:
["100","this, is","a","test"]
What he does is coincidences:
\" -> start by a " \\w -> has a word character \" -> finish by a "
I do not know what values you have, but you can change it as necessary.
source share