Method: UselessString::WithoutHelper#remove_these_words!
- Defined in:
- lib/helpers/without_helper.rb
#remove_these_words!(str, other_str, target_list, case_insensitive: true) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/helpers/without_helper.rb', line 40 def remove_these_words!(str, other_str, target_list, case_insensitive: true) target_list.map { |w| Regexp.escape(w.to_str) } remove_this_regex!(str, other_str, Regexp.new(Regexp.union(target_list).source, case_insensitive)) end |