-(int)getAppearCount:(NSString *)withStr{
NSString *searchStr = @"#BLANK#";
int count=0;
for (int i = 0; i < withStr.length - searchStr.length + 1; i++)
{
if ([[withStr substringWithRange:NSMakeRange(i, searchStr.length)] isEqualToString:searchStr])
{
count++;
}
}
return count;
}
时间: 2024-11-04 12:43:23