Logo

Programming-Idioms

History of Idiom 151 > diff from v3 to v4

Edit summary for version 4 by steenslag:
New Ruby implementation by user [steenslag]

Version 3

2016-10-24, 12:42:34

Version 4

2016-10-26, 12:13:00

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!

Code
p.chomp!