I have the following string with me which came from an XML and saved in String str
:
"welcome "to" the world"
Now I want to replace it completely with an empty string
I have tried
str.replaceAll("welcome "to" the world", ""));
but no luck. Can anyone please guide me?
edited guys as I said earlier the string comes from an XML and gets saved in a String , So in this case I can't add the escape characters to it.
here you go. This is xml that i get
now i store it in a string and want to replace the top line ie. with blank so that I can render it to another place.
hope this helps. Thankyou :)
You have to escape double quotes
"
with a backslash\"
or you can use
Output