How to replace characters in a String?

4

I have a small problem. My application receives a numeric String from the server representing a value. But the server sends, for example "100.00" and I need to put a comma in place of that point.

100.00 = > 100,00

I'd like to know how to do this in the simplest way possible. I used tutorials out there that did not help me.

    
asked by anonymous 27.09.2014 / 22:13

1 answer

4

A "simple" option is to use the replace method of the String .

String valorComPonto = "100.00";
String valorComVirgula = valorComPonto.replace('.', ',');    
    
27.09.2014 / 22:17