fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String input = "[\"edfcb406-b37e-4729-899e-93ea2af71e83\",\"98e75d74-abe2-4c08-8340-06aa9b2faf0b\"]";
  13. System.out.println("Input: " + input);
  14. String ouputAttempt = input.replaceAll("\\[", "").replaceAll("\\]", "").replaceAll("\"", "");
  15. System.out.println("ouputAttempt: " + ouputAttempt);
  16. String cleanedUUIDs = input.replaceAll("[^-,a-zA-Z0-9]", "");
  17. System.out.println("cleanedUUIDs: " + cleanedUUIDs);
  18. }
  19. }
Success #stdin #stdout 0.14s 50372KB
stdin
Standard input is empty
stdout
Input: ["edfcb406-b37e-4729-899e-93ea2af71e83","98e75d74-abe2-4c08-8340-06aa9b2faf0b"]
ouputAttempt: edfcb406-b37e-4729-899e-93ea2af71e83,98e75d74-abe2-4c08-8340-06aa9b2faf0b
cleanedUUIDs: edfcb406-b37e-4729-899e-93ea2af71e83,98e75d74-abe2-4c08-8340-06aa9b2faf0b