Sha256: 2bdf7edf1d82c3c62a95f03d23ef38edc1203be5b260156f0ddc9f702653e964

Contents?: true

Size: 242 Bytes

Versions: 4

Compression:

Stored size: 242 Bytes

Contents

class String

  # Returns true if the string starts with str
  def starts_with?(str)
    str == self[0, str.length]
  end

  # Returns true if the string ends with str
  def ends_with?(str)
    str == self[-str.length, str.length]
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-1.6 lib/nanoc/core_ext/string.rb
nanoc-1.6.1 lib/nanoc/core_ext/string.rb
nanoc-1.5 lib/nanoc/core_ext/string.rb
nanoc-1.6.2 lib/nanoc/core_ext/string.rb