Logo

Programming-Idioms

History of Idiom 151 > diff from v5 to v6

Edit summary for version 6 by steenslag:
[Ruby] emphasize does not work

Version 5

2016-10-26, 13:48:44

Version 6

2016-10-26, 13:49:34

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!("/")
Code
p.chomp!("/")
Comments bubble
Ruby uses _/ as path separator on all platforms, including windows.
Comments bubble
Ruby uses / as path separator on all platforms, including windows.