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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -