Sha256: f9a98245a92734d7874ebda26fd9a7f00399dc0702da26bfd82b632593ef1750

Contents?: true

Size: 203 Bytes

Versions: 3

Compression:

Stored size: 203 Bytes

Contents

class String

  # Removes occurances of a string or regexp.
  #
  #   "HELLO HELLO" - "LL"    #=> "HEO HEO"
  #
  #   CREDIT: Benjamin David Oakes

  def -(pattern)
    self.gsub(pattern, '')
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-2.2.0 lib/core/facets/string/op.rb
facets-2.2.1 lib/core/facets/string/op.rb
facets-2.3.0 lib/core/facets/string/op.rb