Replace input string spaces

0

I have a method that receives a String, but I want to replace each space in the input string with a string consisting of three spaces. How could that start? With a replace?

    
asked by RoyalUp 13.10.2016 в 00:06
source

2 answers

1

link

It should be something like this:

String s= x.replace(' ','   ');
    
answered by 13.10.2016 / 00:09
source
1

Yes, it's with the replace function in java.

string funcionReemplazarEspacios(string cadena) {
    return cadena.replace(" ", "   ");
}
    
answered by 13.10.2016 в 00:13