I have a formatted string which is equal to USD 20
I want to convert it into $20
.
How can I do it efficient? Should I do it with regular expression but since with change in locale the country ISOCode will also change.
I have a formatted string which is equal to USD 20
I want to convert it into $20
.
How can I do it efficient? Should I do it with regular expression but since with change in locale the country ISOCode will also change.
What You need is this
.
and then just concatenate the Amount to the symbol.
Hope this helps.
I believe that this should work for you (this assumes that some
String s
has been declared and initialized):Some references:
and: