System.Concat

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Concat(S1: <string or dynamic array>; S2: <string or dynamic array>; [ ..., SN: <string or dynamic array>]): string; overload;

Properties

Type Visibility Source Unit Parent
function public System.pas System System

Description

Concatenates two or more strings into one string, or two or more dynamic arrays into one dynamic array.

In Delphi code, use Concat to concatenate an arbitrary number of strings or arrays. Each parameter is a string-type expression. The result is the concatenation of all the string parameters or arrays.

S1 - Sn is the string or array elements to concatenate into one string or dynamic array.

String Example

The syntax shown here for Concat demonstrates that the procedure can take a variable number of arguments.

Using the plus (+) operator has the same effect on two strings as using the Concat function:

S := 'ABC' + 'DEF';

Tip: The plus operator is faster than Concat.

Dynamic Array Example

  
  A := Concat([1,2,3],[4,5,6]); //A will become [1,2,3,4,5,6]

See Also

Code Examples