combine

How to concatenate strings in Perl

A Perl FAQ is "How do you concatenate (merge) two or more strings in Perl?"

Use the "." operator

The short answer is that you use the . operator. Here's a simple example:

$name = "alvin" . " " . "alexander";

Of course I could have also done that like this:

$name = "alvin " . "alexander";

but I wanted to show an example with more than two strings.

AppleScript list manipulation examples

AppleScript list FAQ: How do I create lists in AppleScript?

There are several different ways to create AppleScript lists. Let's take a look at a few examples.

AppleScript list creation examples

Here's a quick example of a few different AppleScript lists. First, some favorite foods:

set favoriteFoods to {"cookies", "cake", "cereal"}

Next, some of those other foods:

AppleScript string tip: How to concatenate strings

AppleScript string FAQ: How do I concatenate (merge) strings in AppleScript?

Fortunately string concatenation in AppleScript is pretty easy (if not a little different). To concatenate strings in AppleScript just use the ampersand (&) operator.

Here are a few AppleScript string concatenation examples, with a dialog thrown in so you can see the result: