DelphiBasics
Concat
Function
Concatenates one or more strings into one string System unit
 function Concat(const String1 {,String2 ...} string):string;
Description
The Concat function concatenates (joins) strings String1, String2 ... together into one result string.
 
It is equivalent to the + operator, which is faster.
Related commands
CopyCreate a copy of part of a string or an array
DeleteDelete a section of characters from a string
InsertInsert a string into another string
MoveCopy bytes of data from a source to a destination
StringOfCharCreates a string with one character repeated many times
StringReplaceReplace one or more substrings found within a string
WrapTextAdd line feeds into a string to simulate word wrap
 Download this web site as a Windows program.




 
Example code : Concatenate 3 words into a sentence
var
  result : string;

begin
  // Concatenate using the +
  result := 'Hello '+'cruel '+'World';
  ShowMessage(result);

  // Concatenate using the Concat function
  result := Concat('Hello ','cruel ','World');
  ShowMessage(result);
end;
Show full unit code
  Hello cruel World
  Hello cruel World
 
Delphi Programming © Neil Moffatt 2002 - 2022. All rights reserved.  |  Home Page