For Example : I have a string coming from some Api call like below : And I want to split based on [DART1].
String value = "University[DART1]BUCKKKKK";
String[] splitData = value.split("DART1");
String firstWord = splitData[0].substring(0, splitData[0].length() - 1);
String secondWord = splitData[1].substring(1);
I did a split and removed those special characters from the string, but I was doing lot of operation on string.
Is there a better way of doing this?