• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is Concatenation that complex?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Is Concatenation that complex?
      • From: Gwynne <email@hidden>
    • Re: Is Concatenation that complex?
      • From: Michael Grant <email@hidden>
References: 
 >Is Concatenation that complex? (From: Adam <email@hidden>)
 >Re: Is Concatenation that complex? (From: Marco Scheurer <email@hidden>)
 >Re: Is Concatenation that complex? (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: NSThread or NSTimer
  • Next by Date: Re: NSThread or NSTimer
  • Previous by thread: Re: Is Concatenation that complex?
  • Next by thread: Re: Is Concatenation that complex?
  • Index(es):
    • Date
    • Thread