Sha256: dc9e57428b287d8cdac6a4ce08a33983d0d3c4280ce0bfa93274b5e569257462

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

## String#remove

    require 'facets/string/remove'

Removes all occurances of a string or pattern from a string.

    s = 'xxbooxxfoo'
    s.remove('xx').assert == 'boofoo'

    s = 'xxbooxxfoo'
    s.remove(/x{1,2}/).assert == 'boofoo'

## String#remove!

    s = 'xxbooxxfoo'
    s.remove!('xx')
    s.assert == 'boofoo'

    s = 'xxbooxxfoo'
    s.remove!(/x{1,2}/)
    s.assert == 'boofoo'


## String#op_minus (-)

    s = 'xxbooxxfoo'
    (s - 'xx').assert == 'boofoo'

    s = 'xxbooxxfoo'
    (s - /x{1,2}/).assert == 'boofoo'



Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 demo/core/string/remove.md
facets-3.1.0 demo/core/string/remove.md