Sha256: 42bf6e62092db31532f1a3b8bedbc1e5e9855c0a74cc12cfd0a80229ae2787c8

Contents?: true

Size: 204 Bytes

Versions: 7

Compression:

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

7 entries across 6 versions & 1 rubygems

Version Path
facets-2.9.3 lib/core/facets/string/op_sub.rb
facets-2.9.2 lib/core/facets/string/op_sub.rb
facets-2.9.2 src/core/facets/string/op_sub.rb
facets-2.9.1 lib/core/facets/string/op_sub.rb
facets-2.9.0 lib/core/facets/string/op_sub.rb
facets-2.9.0.pre.2 lib/core/facets/string/op_sub.rb
facets-2.9.0.pre.1 lib/core/facets/string/op_sub.rb