简体   繁体   English

如何查找空格字符是否多次出现在NSString中?

[英]How do I find out if the space character is in a NSString more than once?

How do I find out if the space character is in a NSString more than once? 如何查找空格字符是否多次出现在NSString中? It seems like a simple thing but while looking through the NSString methods I couldn't find the answer. 这看起来很简单但是在查看NSString方法时我找不到答案。

([string componentsSeparatedByString:@" "].count - 1) > 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM