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, 05:04 PM   #5 (permalink)
Gurpartap Singh
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

This is what I used today:

Code:
NSString *string = @"blahblehbLuH";

NSRange startRange = [string rangeOfString:@"blah"];

NSRange endRange = [string rangeOfString:@"bluh"
                                 options:NSCaseInsensitiveSearch];

NSRange subStringRange = NSMakeRange(startRange.length,
                                     endRange.location - startRange.length);

NSString *subString = [string substringWithRange:subStringRange];

NSLog(@"%@", subString); // prints "bleh"
Basically, the first parameter for NSMakeRange function is the index location where the range starts, and the seconds parameter is the length of the sub string.

Colors are fun
Gurpartap Singh is offline   Reply With Quote
 

» Advertisements
» Online Users: 348
16 members and 332 guests
ADY, apatsufas, chemistry, Fit4him, headkaze, ilmman, MarkC, marto1914, Meoz, padsoftware, Promo Dispenser, Raffaello, tathaastu, tgjorgoski, Thrillhouse1919, vogueestylee
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,222
Posts: 380,718
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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