Objective-C: Best way to extract substring from NSString?

nsstring, objective-c

Solution

I know this is a very late reply, but you can get the substring "http://www.abc.com" with the following code:

[@"abc xyz http://www.abc.com aaa bbb ccc" substringWithRange:NSMakeRange(8, 18)]

Of course, you can still use an `NSString` for that.

Problem

I have a space-separated string like `@"abc xyz http://www.example.com aaa bbb ccc"`. How can I extract the substring `@"http://www.example.com"` from it?

Original source