`
mmdev
  • 浏览: 12847053 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

ios开发答疑录系列​---(五)NSString 和NSCharacterset的不同之处

 
阅读更多

============================================================
博文原创,转载请声明出处
============================================================
An NSString object represents a string of ordered characters (text). An NSCharacterSet object represents a set of characters in no particular order. It is often much quicker to determine whether a character is a member of an NSCharacterSet than an NSString. You can't use an NSCharacterSet object to hold text, at least not in any sensible way, because it does not maintain any order of characters, its use is primarily for determining whether a character exists in a set of characters.


我们在nsstring的分割,查找等操作中,经常会提供两种函数,参数类型分别为NSString 和NSCharacterset,有什么不同呢?

NSString 是有序字符串

NSCharacterset是无需字符集合,主要用来判断已知字符串是否包含制定字符集,而不可以用来保存字符串。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics