I see that in many examples it is simply this:
message.replaceAll(nbsp, " ");
Of course it is saying local variable nbsp not found though. How can I simply replace any nbsp in a string with the normal space?
You need to create a local variable String nbsp = " "
or simple use message.replaceAll(" ", " ");
This will also work:
message.replaceAll("\u00a0"," ");
Try:
String message = "a b c";
String nbsp = " ";
message = message.replaceAll(nbsp, " ");
System.out.println(message);
Output: "a b c"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With