Dir To Path

Submitted by:Pitter Alderson

Date added:11 August, 2013

Category:Delphi

Returns the given directory with a trailing backslash. If the directory already ends in backslash it is returned unchanged.

Tags: dir , path

Code Snippet:

function DirToPath(const Dir: string): string;
begin
if (Dir <> '') and (Dir[Length(Dir)] <> '\') then
Result := Dir + '\'
else
Result := Dir;
end;
 
 

Comments