Re: substringToIndex problem
Re: substringToIndex problem
- Subject: Re: substringToIndex problem
- From: "Peter Karlsson" <email@hidden>
- Date: Sat, 31 May 2003 18:57:16 +0000
Thanks, it solved my problem.
Peter
From: Prachi Gauriar <email@hidden>
To: Peter Karlsson <email@hidden>
CC: email@hidden
Subject: Re: substringToIndex problem
Date: Sat, 31 May 2003 13:49:38 -0500
On Saturday, May 31, 2003, at 01:38 PM, Peter Karlsson wrote:
Dear list!
Can someone please tell me why this does not work? All I want to do is: If
the string begins with 'Loop' I want to set the string to Loop.
if ([theValue substringToIndex: 4] == @"Loop")
{
theValue = @"Loop";
}
Peter
You probably need to use [[theValue substringToIndex:4]
isEqualToString:@"Loop"]. Else, it's comparing the addresses. On the
other hand, why don't you try this:
if ([theValue hasPrefix:@"Loop"]) {
theValue = @"Loop";
}
Make sure you don't have any memory leaks though.
-Prachi
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.