System.SysUtils.ExcludeTrailingPathDelimiter

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ExcludeTrailingPathDelimiter(const S: string): string;

C++

extern DELPHI_PACKAGE System::UnicodeString __fastcall ExcludeTrailingPathDelimiter(const System::UnicodeString S)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

Returns a path name without a trailing delimiter.

ExcludeTrailingPathDelimiter returns S, with the trailing path delimiter (PathDelim, '\' on Windows, '/' otherwise) removed. If the last character in S is not a delimiter, then S is returned unchanged.

Note: ExcludeTrailingPathDelimiter works with multibyte character sets (MBCS).

Platform Sample Input (S) Output
Windows C:\Your\Input\Path C:\Your\Input\Path
C:\Your\Input\Path\ C:\Your\Input\Path
OS X
iOS
Android
Linux
/Your/Input/Path /Your/Input/Path
/Your/Input/Path/ /Your/Input/Path

See Also