I used the following code to replace occurrence of '\' but its not working.
msg="\uD83D\uDE0A";
msg=msg.replace("\\", "|");
I spent a lot of time in Google. But didn't find any solution.
Also tried
msg="\uD83D\uDE0A";
msg=msg.replace("\", "|");
The msg
string defined must also use an escape character like this:
msg="\\uD83D\\uDE0A";
msg=msg.replace("\\", "|");
That code will work and it will result in: |uD83D|uDE0A
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