Sha256: b41a2ef475f35b884fc1fd4f4055b902409db52a797406ec8c4e7a2012d0680c

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 7 versions & 2 rubygems

Version Path
facets-2.4.0 lib/facets/string/subtract.rb
facets-2.4.1 lib/facets/string/subtract.rb
facets-2.4.2 lib/core/facets/string/subtract.rb
facets-2.4.3 lib/core/facets/string/subtract.rb
facets-2.4.4 lib/core/facets/string/op_sub.rb
facets-2.4.5 lib/core/facets/string/op_sub.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/string/op_sub.rb