I am trying to get "HelloWorld!" when I first type "Hello World!", but running this program simply returns the same "Hello World!" for me. I know using replace(" ", "") works. But why doesn't string.trim() work? It used to (on pc). https://code.sololearn.com/cAzk2rqIytP2/?ref=app
6/2/2018 5:43:05 PM
Andre Daniel3 Answers
New AnswerAndre Daniel Ah, that's because trim is not supposed to remove spaces in the middle, only start and end. Google java+trim+whitespace
ifl unfortunately, when I enter "Hello World", I get back "Hello World" instead of the intended "HelloWorld". How does it work for you and not me?
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message