java - How convert the char ' to \' in android? -


is possible convert string "hello i'm boss" "hello i\'m boss" how can please

my problem convert ' \'

somebody have idea please??

string a="hello i'm boss"; 

i need

result="hello i\'m boss" 

thanks

you may use replace follows:

string result = a.replace("'","\\'"); 

note original string a not affected operation.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -