Issue
How to convert String format 1.203.45
to string format 1203.45
. Tried to implement regular expressions, but nothing works. Java.
Solution
You could use a regex replacement which removes all dots save the last one:
String input = "1.203.45";
String output = input.replaceAll("\\.(?=.*\\.)", "");
System.out.println(output); \\ 1203.45
Answered By - Tim Biegeleisen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.