I have a string "hi how are... you"
I want to find the Sub-string after how and before you..
How to do this in objective c?
I have a string "hi how are... you"
I want to find the Sub-string after how and before you..
How to do this in objective c?
You could use the method of NSString
substringWithRange
Example
use
SubstringTOIndex
&SubstringFromIndex
functions ofNSString
. WhereSubstringFromIndex
gives you thestring
from the index which you passed &SubstringToIndex
function gives you thestring
upto the index which you passed.Also try
substringWithRange
function which returns you thestring
between the range which you passed.Use
substringWithRange
...Find the range of the two strings and return the substring in between: