iPhone开发 找到字符串的位置

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");

    }

posted @ 2012-02-27 16:42  凡娃软件  阅读(307)  评论(0编辑  收藏  举报