Sha256: 067af05060fcdd8ff3be76ffb1822939322c063bd26c76eda03b4ecf62b5ac4b
Contents?: true
Size: 522 Bytes
Versions: 18
Compression:
Stored size: 522 Bytes
Contents
require_relative './shared' str = 'Lorem ipsum et dolorem' rx = /\S/ cs = CharacterSet.whitespace benchmark( caption: 'Removing non-whitespace', cases: { 'String#gsub' => -> { str.gsub(rx, '') }, 'CharacterSet#keep_in' => -> { cs.keep_in(str) }, } ) str = 'Lorem ipsum ⛷ et dolorem' rx = /\p{^emoji}/ cs = CharacterSet.emoji benchmark( caption: 'Extracting emoji', cases: { 'String#gsub' => -> { str.gsub(rx, '') }, 'CharacterSet#keep_in' => -> { cs.keep_in(str) }, } )
Version data entries
18 entries across 18 versions & 1 rubygems