ios 从一个字符串里查找有几个某字符串
ios 从一个字符串里查找有几个某字符串
日期:2022-02-11 19:57:10 人气:1
假设要查询的字符串味:
NSString *searchStr = @"a string with substr";
查询(是否)被包含的字符串为@"substr",则通过下面的判断:
if ([searchStr rangeOfString:@"substr"].location != NSNotFound) {
NSString *searchStr = @"a string with substr";
查询(是否)被包含的字符串为@"substr",则通过下面的判断:
if ([searchStr rangeOfString:@"substr"].location != NSNotFound) {