program RemoveTrailingPathSeparator;
uses
SysUtils; // ExcludeTrailingPathDelimiter
var
Path: string;
CleanedPath: string;
begin
Path := 'C:\MyFolder\Project\'; // Example with a trailing path separator
CleanedPath := ExcludeTrailingPathDelimiter(Path);
WriteLn(CleanedPath);
end.
(*
run:
C:\MyFolder\Project
*)