Unit 'sysutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

ConcatPaths

Concatenate an array of paths to form a single path.

Declaration

Source position: finah.inc line 46

function ConcatPaths(

  const Paths: array of UnicodeString

):UnicodeString;

function ConcatPaths(

  const Paths: array of RawByteString

):RawByteString;

Description

ConcatPaths will concatenate the different path components in Paths to a single path. It will insert directory separators between the various components of the path as needed. No directory separators will be added to the beginning or the end of the path, and none will be taken away.

See also

IncludeTrailingPathDelimiter

  

Add trailing directory separator to a pathname, if needed.

IncludeLeadingPathDelimiter

  

Prepend a path delimiter if there is not already one.

ExcludeTrailingPathDelimiter

  

Strip trailing directory separator from a pathname, if needed.

IncludeTrailingPathDelimiter

  

Add trailing directory separator to a pathname, if needed.

Example

program ex96;

{ This program demonstrates the Concatpaths function }

uses sysutils;

begin
  // will write /this/path/more/levels/
  Writeln(ConcatPaths(['/this/','path','more/levels/']));
  // will write this/path/more/levels/
  Writeln(ConcatPaths(['this/','path','more/levels/']));
  // will write this/path/more/levels
  Writeln(ConcatPaths(['this/','path','more/levels']));
end.

Documentation generated on: Oct 02 2024