I have a text like this:
“@joemcelderry91: I've woken up with the flu I think! :( gunna try and
run it off haha!! X” get well soon joey :)
I want to get rid of the double quotes in the sentence. After removal it should be like
@joemcelderry91: I've woken up with the flu I think! :( gunna try and
run it off haha!! X get well soon joey :)
Does anybody have suggestions for removing this so far I have tried this still no luck:
.replaceAll("\"", "");
Answer
It seems like you included a different quotes. So Your regex would be,
"[“”\"]"
Replace it with an empty string.
OR
If it's a special double quotes then use the below code to remove it from from the string,
String str = "“@joemcelderry91: I've woken up with the flu I think! :( gunna try and run it off haha!! X” get well soon joey :)";
String s = str.replaceAll("[“”]", "");
System.out.println(s);
Output:
@joemcelderry91: I've woken up with the flu I think! :( gunna try and run it off haha!! X get well soon joey :)
No comments:
Post a Comment