Java Tutorial/Regular Expressions/Split — различия между версиями
| Admin (обсуждение | вклад)  м (1 версия) | 
| (нет различий) | 
Текущая версия на 15:19, 31 мая 2010
Split a string
public class MainClass {
  public static void main(String args[]) {
    String splitPattern = ",";
    String sentence = "This is a test, and that is another test.";
    String[] tokens = sentence.split(splitPattern);
    for (String s : tokens) {
      System.out.println(s);
    }
  }
}
   
