Split an NSString to access one particular piece
NSArray* foo = [@”10/04/2011″ componentsSeparatedByString: @”https://stackoverflow.com/”]; NSString* firstBit = [foo objectAtIndex: 0]; Update 7/3/2018: Now that the question has acquired a Swift tag, I should add the Swift way of doing this. It’s pretty much as simple: let substrings = “10/04/2011”.split(separator: “https://stackoverflow.com/”) let firstBit = substrings[0] Although note that it gives you an array of … Read more