我有一个从 http GET 返回的大字符串,我正在尝试确定它是否有特定的文本片段(请在这里原谅我的罪过)
我的问题是:我可以/应该使用 NSRange 来确定这段文本是否存在吗?
NSRange textRange;
textRange =[[responseString lowercaseString] rangeOfString:[@"hat" lowercaseString]];
if(textRange.location != NSNotFound)
{
//do something magical with this hat
}
先感谢您!