method

remove

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: String
remove(*patterns) public

Returns a new string with all occurrences of the patterns removed.

str = "foo bar test"
str.remove(" test")                 # => "foo bar"
str.remove(" test", /bar/)          # => "foo "
str                                 # => "foo bar test"
Show source
Register or log in to add new notes.