Sha256: 4e118eea640749588985e22388131b96fffb12e873dc28ae40ae5316bf223e9b
Contents?: true
Size: 256 Bytes
Versions: 10
Compression:
Stored size: 256 Bytes
Contents
class String def starts_with?(prefix) pattern = Regexp.new "^#{Regexp.escape(prefix)}" not ( pattern =~ self ).nil? end def ends_with?(suffix) pattern = Regexp.new "#{Regexp.escape(suffix)}$" not ( pattern =~ self ).nil? end end
Version data entries
10 entries across 10 versions & 1 rubygems