add String#strip_prefix
This commit is contained in:
parent
18a743c470
commit
9755662e49
@ -21,6 +21,10 @@ class String
|
||||
s = chomp
|
||||
s unless s.empty?
|
||||
end
|
||||
|
||||
def strip_prefix(prefix)
|
||||
start_with?(prefix) ? self[prefix.length..-1] : self
|
||||
end
|
||||
end
|
||||
|
||||
class NilClass
|
||||
|
Loading…
x
Reference in New Issue
Block a user