System.AnsiStrings.ExcludeTrailingPathDelimiter

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ExcludeTrailingPathDelimiter(const S: AnsiString): AnsiString;

C++

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

Properties

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

Description

Returns a path name without a trailing delimiter.

Note: Do not use this method for new development. In particular, if you are doing multi-device development, we recommend that you use the next-generation implementation, System.SysUtils.ExcludeTrailingPathDelimiter, which provides support for mobile platforms as well.

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 /Your/Input/Path /Your/Input/Path
/Your/Input/Path/ /Your/Input/Path
iOS
Android
This method does not support mobile platforms.

See Also