How to check if NSString begins with a certain character
You can use the -hasPrefix: method of NSString: Objective-C: NSString* output = nil; if([string hasPrefix:@”*”]) { output = [string substringFromIndex:1]; } Swift: var output:String? if string.hasPrefix(“*”) { output = string.substringFromIndex(string.startIndex.advancedBy(1)) }