merge

Scala - Merging two Arrays or ArrayBuffers

Scala Array FAQ: How do I merge two Arrays or ArrayBuffers?

Solution: Use the ++ method to join two arrays into one new array:

scala> val a = Array(1,2,3)
a: Array[Int] = Array(1, 2, 3)

scala> val b = Array(4,5,6)
b: Array[Int] = Array(4, 5, 6)

scala> val c = a ++ b
c: Array[Int] = Array(1, 2, 3, 4, 5, 6)

ArrayBuffer

Use the same approach to merge two ArrayBuffers into a new ArrayBuffer:

The Git 'topic branch' workflow (pattern)

In this short article, I'll demonstrate the typical workflow for using a Git topic branch. If you've never heard of a topic branch, here's a description from the excellent book, Pro Git:

"A topic branch is a short-lived branch that you create and use for a single particular feature or related work.

How to merge Scala Lists

Scala List FAQ: How do I merge Scala Lists?

There are at least three ways to merge/concatenate Scala List instances, as shown in the examples below.

1) The Scala List ::: method

First, you can merge two Scala lists using the ::: method of the List class, as demonstrated here at the Scala command prompt:

Perl string concatenation - How to concatenate strings with Perl

Perl string FAQ: How do I concatenate Perl strings?

When you work with Perl, you're often working with strings, and very often you need to concatenate strings. For instance, I recently had a need to create a temporary filename, and wanted to use the original filename as part of the temporary name.

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 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:

Sat, Dec 14, 2002

I recently ran into a problem where I had about 50 individual HTML documents, with each document was about 2 pages long,  that I wanted to merge into one big HTML document. After merging all of these into one big document, I wanted them to print with their pages numbered 1-100. 

Java String concatenation - How to combine two Strings

Java String concatenation FAQ: How do I merge/combine two Java String fields?

You can merge / concatenate /combine two Java String fields using the + operator, as shown in this Java String example code:

Syndicate content