iphone - Split an NSString -
quick question. need split nsstring, if contains substring. can show me example of how this?
// string string = result: 123.23 // bad string (has no result prefix) string = asldkfjasdlkfj if( string has "result: " in ) { string2 = (something returns 123.23 part) }
thanks much!
alright then, 2 quick methods:
-[nsstring hasprefix:] -[nsstring substringfromindex:]
however don't forget handle invalid cases.
Comments
Post a Comment