Home  |  Delphi .net Home  |  System.String  |  Concat Method
  
Concat  
Method  
Concatenates one or more instances of String, or the String objects
String Class
System NameSpace
CF1.  Function Concat ( ValueA : String; ValueB : String ) : String;
CF2.  Function Concat ( ValueA : String; ValueB : String; ValueC : String ) : String;
CF3.  Function Concat ( ValueA : String; ValueB : String; ValueC : String; ValueD : String ) : String;
CF4.  Function Concat ( Value : Object ) : String;
CF5.  Function Concat ( ValueA : Object; ValueB : Object ) : String;
CF6.  Function Concat ( ValueA : Object; ValueB : Object; ValueC : Object ) : String;
CF7.  Function Concat ( ValueA : Object; ValueB : Object; ValueC : Object; ValueD : Object ) : String;
CF8.  Function Concat ( ValueArray : Array of String ) : String;
CF9.  Function Concat ( ValueArray : Array of Object ) : String;
CF : Methods with this mark are Compact Framework Compatible
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
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
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.
   strA + strB         = ABCDE---
   objA+objB+objA+objB = ABCDE---ABCDE---ABCDE
   strArray            = Hello cruel World
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author