Objective C IndexOf String
Hey, I am trying to get the INDEX of a specific STRING in a string. I went through the API and looked at rangeOfString and whatnot but that is not what I am looking for. Here is what I need...
String s="Make money with iPhone apps";
int beginIndex=s.indexOf("iPhone");
beginIndex should equal 16.
Then from there I should be able to use substringWithRange and substring from beginIndex to beginIndex+6, to get a final string of "iPhone".
This is just an example, not exactly what I need to do but I need to find this. The reason is because I have a multi thousand character string and need to find the index of specific strings in it.
Thanks
|