Objective-C中判断字符串是否包含其他字符串
-(BOOL)hasPrefix:(NSString*)astring;检查字符串是否以astring开头;
-(BOOL)hasSuffix:(NSString*)astring;检查字符串是否以astring结尾;
如果想知道字符串内的某处是否包含其他的字符串,使用rangeOfString:
-(NSRange)rangeOfString:(NSString*)astring;
相关推荐
fort0 2020-05-16
81570790 2020-04-16
86540698 2020-04-08
zhoutaifeng 2020-03-07
好好学习天天 2020-03-06
InterestSoul 2020-02-17
82467413 2019-12-31
84407518 2012-07-16
81570790 2013-07-01
83254851 2013-08-29
84334052 2019-11-19
86540698 2019-11-19
84467715 2011-07-25
81731290 2014-03-22
85437811 2014-03-22
dahuichen 2019-10-25
ObjectiveC 2011-09-20
80530297 2015-04-14
80530297 2015-04-20