fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String s = "52,52d\n"
  10. + "65.00f\n"
  11. + "123,50\n"
  12. + "1,234,567,89\n"
  13. + "1,234,567.89";
  14.  
  15. System.out.println(s
  16. .replaceAll(",(?=\\d+[df]?(?!\\S))", ".")
  17. .replaceAll(",", "")
  18. );
  19. }
  20. }
Success #stdin #stdout 0.08s 48260KB
stdin
Standard input is empty
stdout
52.52d
65.00f
123.50
1234567.89
1234567.89