Sha256: da4ca17232dbf65bf0950ee9ad07016438ee88276f7ea7d1b7debca3674b579b

Contents?: true

Size: 202 Bytes

Versions: 10

Compression:

Stored size: 202 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

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/string/op_sub.rb
facets-2.8.3 lib/core/facets/string/op_sub.rb
facets-2.8.2 lib/core/facets/string/op_sub.rb
facets-2.8.1 lib/core/facets/string/op_sub.rb
facets-2.8.0 lib/core/facets/string/op_sub.rb
facets-2.7.0 lib/core/facets/string/op_sub.rb
facets-2.6.0 lib/core/facets/string/op_sub.rb
facets-2.5.1 lib/core/facets/string/op_sub.rb
facets-2.5.0 lib/core/facets/string/op_sub.rb
facets-2.5.2 lib/core/facets/string/op_sub.rb