3
myString = "my name=\"ppshein\""

How can I remove "=\"ppshein\"" from the above string in Android?

5 Answers 5

10

You can remove strings this way:

string.replace("=\"ppshein\"", "");
Sign up to request clarification or add additional context in comments.

1 Comment

string.replace("\" with \\\"", "");
2
myString.replace("=\"ppshein\"", "");

Comments

1

Assuming you have a string called myString and you want a new string with all occurrences of ="ppshein" removed, try

String newString = myString.replace("=\"ppshein\"", "")

Comments

1

First of all, the above string won't compile. you need to write it like: myString = "my name=\"ppshein\""

Secondly, use: myString = myString.replace("=\"ppshein\"", "");

Comments

0
myString = myString.replaceAll("StringToReplace", "");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.