Programming-Idioms

History of Idiom 151 > diff from v7 to v8

Edit summary for version 8 :
New Pascal implementation by user [Bart]

Version 7

2016-11-09, 17:48:59

Version 8

2016-11-09, 17:51:42

Idiom #151 Remove string trailing path separator

Remove last character from string p, if this character is the file path separator of current platform.

Note that this also transforms unix root path "/" into empty string!

Idiom #151 Remove string trailing path separator

Remove last character from string p, if this character is the file path separator of current platform.

Note that this also transforms unix root path "/" into empty string!

Imports
LazFileUtils
Code
begin
  p := ChompPathDelim(p);
end.
Comments bubble
This one will leave unix root "/" untouched and likewise "\" on Windows and WinCE.