Sha256: 15fba9f865a29bee6988335c69cfb81d0598eb233ded84e0f1f42f14f1f02cd8
Contents?: true
Size: 475 Bytes
Versions: 20
Compression:
Stored size: 475 Bytes
Contents
class String # Left chomp. # # "help".lchomp("h") #=> "elp" # "help".lchomp("k") #=> "help" # # CREDIT: Trans def lchomp(match) if index(match) == 0 self[match.size..-1] else self.dup end end # In-place left chomp. # # "help".lchomp("h") #=> "elp" # "help".lchomp("k") #=> "help" # # CREDIT: Trans def lchomp!(match) if index(match) == 0 self[0...match.size] = '' self end end end
Version data entries
20 entries across 19 versions & 2 rubygems