Hi all,

The below snippet displays the result as not equals instead of equals

        String s = "11 567 747,18 €";
        String s1 = s.replaceAll(" ","");
        String s2 = s1.replaceAll("€","");
        String s3 = s2.replaceAll(",",".");

        String pattern = "# ###,##.##¤";
        DecimalFormat df = (DecimalFormat)NumberFormat.getNumberInstance(Locale.FRANCE);
        String format = df.format(11567747.18);

            System.out.println("not equlas");


11 567 747,18 €
11 567 747,18 €not equlas

could anyone please help me to sort it out?
I tried checking equality of individual chars, it displays not equals in the in the blankspace place after 11 and 567

Views: 85

Reply to This

Replies to This Discussion


I ran your code snippet in https://ideone.com/ with the required imports and class and main method and got the following output.

11,567,747.18 EUR

11 567 747,18 €

not equlas

Hope that helps,



Hi Martin,

   Thank you so much. I sorted it out.



© 2017   Created by Rosie Sherry.   Powered by

Badges  |  Report an Issue  |  Terms of Service