fork download
  1. import java.util.Arrays;
  2. class Main
  3. {
  4. public static void main (String[] args) throws java.lang.Exception
  5. {
  6. String str = "423545(50),7568787(50),53654656,2021947(50),";
  7. String[] list = str.split("(\\(\\d+\\))?,");
  8. System.out.println(Arrays.toString(list));
  9. }
  10. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
[423545, 7568787, 53654656, 2021947]