mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
commit
e6b9f130a6
1 changed files with 3 additions and 3 deletions
|
@ -20,12 +20,12 @@ class String
|
|||
self
|
||||
end
|
||||
|
||||
# Returns a new string with all occurances of the pattern removed. Short-hand for String#gsub(pattern, '').
|
||||
# Returns a new string with all occurrences of the pattern removed. Short-hand for String#gsub(pattern, '').
|
||||
def remove(pattern)
|
||||
gsub pattern, ''
|
||||
gsub pattern, ''
|
||||
end
|
||||
|
||||
# Alters the string by removing all occurances of the pattern. Short-hand for String#gsub!(pattern, '').
|
||||
# Alters the string by removing all occurrences of the pattern. Short-hand for String#gsub!(pattern, '').
|
||||
def remove!(pattern)
|
||||
gsub! pattern, ''
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue