On 06/06/2012 20:53, Antonio R. de Oliveira wrote:
> I want to remove symbols and text from formatted String when using
> /NumberFormat.getCurrencyFormat().format()/ with internationalization.
>
> Examples after remove:
>
> Currency - Formated = Without
>
> US: US$100.15 = 100.15
> BRL: 100,15R$ = 100,15
> Euro: 100,15€ = 100,15
A possible solution:
String data = "US$100.15\n" +
"100,15R$\n" +
"100,15€\n";
String res = data.replaceAll("[^\n\\d,.]+", "");
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment