Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

replace a " from a String in Android Studio

i have this string
String answer = ""true<;
And I want to delete the " before the true.

You can delete everything else with the

 answer = answer.replace(" ", "");

But with the " it does not work

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I don’t want to delete a space but delete the character " from a string

>Solution :

try this out:

answer= answer.replace("\"", "");

When using replace and other functions, if you want a special character to be regarded as a character rather than a special character, you must use that character /

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading