How can I split a String
using combine special characters?
For example, if the combine Special characters is {@}
:
String str = "This is test string1.{@}This is test string2@(#*$ ((@@{}";
StringTokenizer stoken = new StringTokenizer(str, "\\{\\@\\}");
while (stoken.hasMoreElements()) {
System.out.println(stoken.nextElement());
}
What I expect from above program is :
This is test string1.
This is test string2@(#*$ ((@@{}