Skip to content

IncludeLeadingPathDelimiter

Prepend a path delimiter if there is not already one.

Declaration

Source position: finah.inc line 38

  function IncludeLeadingPathDelimiter(const Path: UNICODESTRING)
                                       : UNICODESTRING;
  function IncludeLeadingPathDelimiter(const Path: RAWBYTESTRING)
                                       : RAWBYTESTRING;

Description

IncludeLeadingPathDelimiter will insert a path delimiter (#rtl.system.DirectorySeparator ) in the first position of Path, if there is not already a directory separator at that position. It will return the resulting string. If the path is empty, a DirectorySeparator character is returned.

See also

Name Description
ConcatPaths Concatenate an array of paths to form a single path
ExcludeLeadingPathDelimiter Strip the leading path delimiter of a path
ExcludeTrailingPathDelimiter Strip trailing directory separator from a pathname, if needed.
IncludeTrailingPathDelimiter Add trailing directory separator to a pathname, if needed.

Example

Program Example94;
{ This program demonstrates the IncludeLeadingPathDelimiter function }
Uses sysutils;
Begin
End.