Re: Is Concatenation that complex?
Re: Is Concatenation that complex?
- Subject: Re: Is Concatenation that complex?
- From: Bob Ippolito <email@hidden>
- Date: Tue, 27 Apr 2004 15:44:58 -0400
On Apr 27, 2004, at 3:02 PM, Finlay Dobbie wrote:
On 23 Apr 2004, at 09:40, Marco Scheurer wrote:
On Apr 23, 2004, at 4:58 AM, Adam wrote:
Newbie coming from java here.
I am looking to concatenate strings. In java I could do complex
string concatenation mixing variables and string literals in one
line:
String middle = "insane root";
String RelevantQuote = "Or have we eaten on the" + middle + "that
takes the reason prisoner?"
I cannot resist mentioning how ugly using "+" for concatenation is
(IMHO). In my book "+" is used for, among other properties,
commutative operations. Here a+b is not the same as b+a. Any other
symbol would have been better, for instance ",", or maybe even no
symbol at all.
Perl uses "." for string concatenation IIRC.
and I believe that VB and Lingo use & .. so what? :)
For joining a lot of strings together without operator support it
probably makes sense to use a format or to use an array join rather
than doing lots of 2-string concatenation.
-bob
_______________________________________________
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.