public static void main(String[] args){
String s=new String("f;sjdkfd:fdsfdf;df:FD::D:::F:RE:FRER:F:ER:FR:F:RF:GR:G:RG: :P");
String[] ss = s.split(":");
for(String token : ss){
System.out.println(token);
}
}
using this code, I can get the token between “:”. But I wan to split the text with both “:”and”;” at the same time. is that possible?
You could use character class instead: