Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-07-2009, 11:45 AM   #1 (permalink)
PhysX
Registered Member
 
Join Date: Nov 2008
Posts: 57
Default 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
PhysX is offline   Reply With Quote
 

» Advertisements
» Online Users: 317
19 members and 298 guests
ADY, BdR, BrianSlick, Diegan, djohnson, Duncan C, F_Bryant, Herbie, ilmman, Joseph Nardone, laurielaptop, M@realobjects, Profile, rob.mccarthy, rodgo, TheWebWizz, VikMyr, vogueestylee, yomo710
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,702
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:52 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.