Concatenation Operators

Sequences (that is, IEnumerable(Of T) objects) expose a method named Concat that allows creating a new sequence containing items from two sequences. The following code shows an example in which a new sequence of strings is created from two existing arrays of strings:

image

The result produced by this code is that the concatSequence variable contains the following items: “One”, “Two”, “Three”, “Four”, “Five”, and “Six”. The first items in the new sequence are taken from the one you invoke the Concat method on.

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.