Objective-C查找和替换字符串问题

时间:2022-05-23 19:19:08

im trying to do a find and replace on a string to do

我试图做一个查找和替换字符串来做

tempString =[tempString stringByReplacingOccurrencesOfString:@""" withString:@"""];

but it does not work with the """, is there anyway i can wrap the quote so i can use it?

但它不适用于“”“,无论如何,我可以包装报价,以便我可以使用它吗?

2 个解决方案

#1


21  

Have you tried a backslash before the second "? A la:

你有没有在第二次尝试反斜杠“?答:

tempString = [tempString stringByReplacingOccurrencesOfString:@""" withString:@"\""];

#2


0  

nevermind , have sorted the issue

没关系,已经解决了问题

tempString =[tempString stringByReplacingOccurrencesOfString:@""" withString:@"\""];

thanks for looking :)

谢谢你看:)

#1


21  

Have you tried a backslash before the second "? A la:

你有没有在第二次尝试反斜杠“?答:

tempString = [tempString stringByReplacingOccurrencesOfString:@""" withString:@"\""];

#2


0  

nevermind , have sorted the issue

没关系,已经解决了问题

tempString =[tempString stringByReplacingOccurrencesOfString:@""" withString:@"\""];

thanks for looking :)

谢谢你看:)