Re: Glueing strings together...
Re: Glueing strings together...
- Subject: Re: Glueing strings together...
- From: JuL <email@hidden>
- Date: Tue, 13 Jan 2004 16:36:07 +0100
Hi,
I think it's much nicer to do
myString = [theArray componentsJoinedByString:@"\n"];
Regards,
JuL
Hi!
I have a loop in which I need to glue strings together. Like this:
for (i=0; i<[ theArray count]; i++) {
myString = [ myString stringByAppendingFormat:"\n%@", [ theArray
objectAtIndex:i]];
}
This works well. My only concern is memory leaking. I am creating a
new string and setting my pointer to this new string, but does the old
(original) string get released?
What is the proper way to build a string out of many parts?
- Michael
_______________________________________________
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.
_______________________________________________
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.