You can use the second parameter splitas shown in the Java doc
If you want to split as many times as possible, use:
"test1=test1=test1=".split("=", 0); // ["test1","test1","test1"]
If you want the split to happen only once, use:
"test1=test1=test1=".split("=", 2); // ["test1","test1=test1="]
source
share