NSString * str=[[NSStringalloc]init];
str=@"1234567890";
NSRange r;
r=[str rangeOfString:textview.text];
if (r.location!=NSNotFound) {
NSLog(@"found at location = %d,length = %d",r.location,r.length);
}
else
{
NSLog(@"not found");
}
摘自 凡娃軟件