Sha256: 2819db961981ddff1941a6f63063a6263986428d3a77d377afc52dbba6129db6
Contents?: true
Size: 268 Bytes
Versions: 3
Compression:
Stored size: 268 Bytes
Contents
class String # Like #index but returns a Range. # # require 'facet/string/range' # # "This is a test!".rand('test') #=> 10..13 # def range(s, offset=0) if self.index(s, offset) return ($~.begin(0))..($~.end(0)-1) end nil end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
facets-0.7.0 | lib/facet/string/range.rb |
facets-0.7.1 | lib/facet/string/range.rb |
facets-0.7.2 | lib/facet/string/range.rb |