System.SysUtils.IncludeTrailingPathDelimiter

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function IncludeTrailingPathDelimiter(const S: string): string;

C++

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

Properties

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

Description

Ensures that path name ends with a delimiter.

IncludeTrailingPathDelimiter ensures that a path name ends with a trailing path delimiter (PathDelim, '\' on Windows, '/' otherwise). If S already ends with a trailing delimiter character, it is returned unchanged; otherwise, S with an appended delimiter character is returned.

Note: IncludeTrailingPathDelimiter 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\
Mac OS X
iOS
Android
/Your/Input/Path /Your/Input/Path/
/Your/Input/Path/ /Your/Input/Path/

See Also