fork download
  1. public class Main {
  2. public static void main(String[] args) {
  3. String str = "1, 2, 3, 4, 5";
  4. String delimiter = ",";
  5. String[] temp = str.split(delimiter);
  6. int count = temp.length;
  7. System.out.println(count);
  8. }
  9. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
5