Mega Code Archive

 
Categories / Java Tutorial / Data Type
 

Using split() with a space can be a problem

public class Main {   public static void main(String args[]) throws Exception {     String s3 = "A  B C";     String[] words = s3.split(" ");     for (String s : words) {       System.out.println(s);     }   } } /* A B C */