Re: How to concatenate two values?
Re: How to concatenate two values?
- Subject: Re: How to concatenate two values?
- From: Chris Garaffa <email@hidden>
- Date: Thu, 03 Mar 2005 18:32:22 -0500
Title: Re: How to concatenate two values?
From: Ronald Hofmann <email@hidden>
Date: Thu, 3 Mar 2005 15:20:03 +0100
My problem is as follows:
I have values which already work fine.
NSCalendarDate *now=[NSCalendarDate calendarDate];//this is a date
value
NSString *myPath = NSHomeDirectory();//this is a string value
I want to concatenate both values.
Try something like this (untested, written in Entourage):
NSString *newString = [[NSString alloc] initWithFormat: @”%@%@”, myPath, [now description]];
Check the NSCalendarDate documentation for the method –descriptionWithCalendarFormat, which will allow you to specify how the date is displayed.
Alternatively, I’m 99% sure you could also do this:
NSMutableString *newString = [NSHomeDirectory() mutableCopy];
[newString appendString: [now description]];
Which would remove the need for the myPath variable.
HTH
--
Chris Garaffa
Technician
TracyLocke
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden