RAD Studio VCL Reference
SysUtils.ExcludeTrailingPathDelimiter Function

Returns a path name without a trailing delimiter.

function ExcludeTrailingPathDelimiter(const S: string): string; overload;
AnsiString ExcludeTrailingPathDelimiter(const AnsiString S);

ExcludeTrailingPathDelimiter returns S with any trailing path delimiter ('\' on Windows, '/' on Linux) removed. If the last character in S is a delimiter, the return value is S with the last character removed. Otherwise, S is returned unchanged.

Note: ExcludeTrailingPathDelimiter works with multibyte character sets.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!