NSRange range = [string rangeOfString:@"ate"];
NSString *substring = [[string substringFromIndex:NSMaxRange(range)] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
More Related Contents:
- Number of occurrences of a substring in an NSString?
- Split an NSString to access one particular piece
- Replacing one character in a string in Objective-C
- NSString – Convert to pure alphabet only (i.e. remove accents+punctuation)
- Create multiple numbered variables based on a int
- Understanding NSString comparison
- Convert NSDate to NSString
- How do I check if a string contains another string in Objective-C?
- How to convert an NSString into an NSNumber
- How to add percent sign to NSString
- Converting a string to an NSDate
- Remove all but numbers from NSString
- What’s the difference between a string constant and a string literal?
- Collapse sequences of white space into a single character and trim string
- Comparing Strings in Cocoa
- NSString (hex) to bytes
- Converting escaped UTF8 characters back to their original form
- String comparison in Objective-C
- Generate a random alphanumeric string in Cocoa
- Is there a simple way to split a NSString into an array of characters?
- Search through NSString using Regular Expression
- How to add commas to number every 3 digits in Objective C?
- Remove characters from NSString?
- How to use NSScanner?
- Get parts of a NSURL in objective-c
- NSString : easy way to remove UTF-8 accents from a string?
- How Can I Draw Image with Text Wrapping on iOS?
- How to declare a two dimensional array of string type in Objective-C?
- How to get the width of an NSString?
- Anyway to get string from variable name?