If I want to get a value from the NSString @\"value:hello World:value\", what should I use?
@\"value:hello World:value\"
The return value I want is @\"hello World\".
@\"hello World\"
Here's a slightly less complicated answer:
NSString *myString = @"abcdefg"; NSString *mySmallerString = [myString substringToIndex:4];
See also substringWithRange and substringFromIndex