Mega Code Archive

 
Categories / Java Tutorial / Data Type
 

String split() is based on regular expression

public class Main {   public static void main(String args[]) throws Exception {     String s3 = "{A}{this is a test}{1234}";     String[] words = s3.split("[{}]");     for (String str : words) {       System.out.println(str);     }   } } /* A this is a test 1234 */