I have a string like
String str = "My name is Monda"
How can I achieve a string like
str = "MynameisMonda"
You can use the replaceAll() function.
replaceAll()
For your case:
replaceAll("\s","")
where s means any whitespace (such as a space character).
s
2.1m questions
2.1m answers
60 comments
57.0k users