Re: NSString/NSMutable String Concatenation
Re: NSString/NSMutable String Concatenation
- Subject: Re: NSString/NSMutable String Concatenation
- From: Randall Meadows <email@hidden>
- Date: Wed, 3 Sep 2008 16:02:38 -0600
On Sep 3, 2008, at 3:57 PM, Michael Stearne wrote:
I'm new to OS X development and Objective C. I have a NSString (or
NSMutableString if that is wiser) and I would like to add text on to
the end
of it.
In PHP it would be something like:
$myString=$myString." more stuff";
I have looked around for docs on this but they are confusing (based
on my
newbie status and background).
If there a simple equivalent of the code above for Objective C?
If you have an NSString, you can use -stringByAppendingString:, which
gives you back a new NSString object (different from the one you had
initially). There are variants, like -stringByAppendingFormat:, etc.
If you have an NSMutableString, -appendString:, -appendFormat:. These
modify the receiver directly.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden