mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/csv] Refactor range in delete_suffix (#85)
https://github.com/ruby/csv/commit/7ff57a50e8
This commit is contained in:
parent
864e2a95d9
commit
9171f83305
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ unless String.method_defined?(:delete_suffix)
|
|||
refine String do
|
||||
def delete_suffix(suffix)
|
||||
if end_with?(suffix)
|
||||
self[0..(-(suffix.size + 1))]
|
||||
self[0...-suffix.size]
|
||||
else
|
||||
self
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue