从NSString删除字符? [英] Remove characters from NSString?
本文介绍了从NSString删除字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
NSString *myString = @"A B C D E F G";
我要删除空格,因此新字符串将为"ABCDEFG".
I want to remove the spaces, so the new string would be "ABCDEFG".
推荐答案
您可以使用:
NSString *stringWithoutSpaces = [myString
stringByReplacingOccurrencesOfString:@" " withString:@""];
这篇关于从NSString删除字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文