Logo

Programming-Idioms

History of Idiom 151 > diff from v14 to v15

Edit summary for version 15 by bigwavedave:
New Csharp implementation by user [bigwavedave]

Version 14

2019-09-28, 09:12:17

Version 15

2019-10-08, 21:14:43

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!

Extra Keywords
trim
Extra Keywords
trim
Imports
using System.IO;
Code
p.TrimEnd(Path.DirectorySeparatorChar);