Remove http:// from NSString

Like this?

NSString* stringWithoutHttp = [someString stringByReplacingOccurrencesOfString:@"http://" withString:@""];

(if you want to remove text at the beginning only, do what jtbandes says - the code above will replace occurrences in the middle of the string as well)


Here's a solution which takes care of http & https:

    NSString *shortenedURL = url.absoluteURL;

    if ([shortenedURL hasPrefix:@"https://"]) shortenedURL = [shortenedURL substringFromIndex:8];
    if ([shortenedURL hasPrefix:@"http://"]) shortenedURL = [shortenedURL substringFromIndex:7];

NSString *newString = [myString stringByReplacingOccurrencesOfString:@"http://"
                                                          withString:@""
                                                             options:NSAnchoredSearch // beginning of string
                                                               range:NSMakeRange(0, [myString length])]