当前位置:编程学习 > wap >>

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

    }

 

摘自 凡娃软件
补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,