且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在两个已知字符串之间搜索一个字符串

更新时间:2022-12-29 08:44:51

我明白了!

这是代码(写得不太好):

This is the code (not very nice written):

NSRange rr2 = [content rangeOfString:@"href=\""];
    NSRange rr3 = [content rangeOfString:@"\" />"];
    int lengt = rr3.location - rr2.location - rr2.length;
    int location = rr2.location + rr2.length;
    NSRange aa;
    aa.location = location;
    aa.length = lengt;
    theString = [theString substringWithRange:aa];