Description |
The parameter strings are contenated into a single result string.
Objects that have string representations may be used as parameters.
Up to 4 strings may be concatenated individually. To concatenate more, the strings must be provided in an array.
|
|
Microsoft MSDN Links |
system
system.String
|
|
|
Examples of string, string-array and object concatenations |
program Project1;
{$APPTYPE CONSOLE}
var
strA, strB : String;
result : String;
strArray : Array[1..3] of String;
objA, objB : TObject;
begin
strA := 'ABCDE';
strB := '---';
strArray[1] := 'Hello ';
strArray[2] := 'cruel ';
strArray[3] := 'World';
objA := strA;
objB := strB;
result := System.String.Concat(strA, strB);
Console.WriteLine('strA + strB = ' + result);
result := System.String.Concat(objA, objB, objA, objB);
Console.WriteLine('objA+objB+objA+objB = ' + result);
result := System.String.Concat(strArray);
Console.WriteLine('strArray = ' + result);
Console.ReadLine;
end.
| Show full unit code | strA + strB = ABCDE---
objA+objB+objA+objB = ABCDE---ABCDE---ABCDE
strArray = Hello cruel World
|
|
|
|