Skip to content

ExcludeLeadingPathDelimiter

Strip the leading path delimiter of a path

Declaration

Source position: finah.inc line 39

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

Description

ExcludeLeadingPathDelimiter will remove any path delimiter on the first position of Path if there is one. if there is none (or the path is empty), it is left untouched.

See also

Name Description
ConcatPaths Concatenate an array of paths to form a single path
ExcludeTrailingPathDelimiter Strip trailing directory separator from a pathname, if needed.
IncludeLeadingPathDelimiter Prepend a path delimiter if there is not already one.
IncludeTrailingPathDelimiter Add trailing directory separator to a pathname, if needed.

Example

Program Example95;
{ This program demonstrates the IncludeLeadingPathDelimiter function }
Uses sysutils;
Begin
  // Will print "/this/path"
  Writeln(IncludeLeadingPathDelimiter('this/path'));
  // The same result 
  Writeln(IncludeLeadingPathDelimiter('/this/path'));
End.