Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/kramdown/compatibility.rb

Instance Method Summary collapse

Instance Method Details

#end_with?(str) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/kramdown/compatibility.rb', line 42

def end_with?(str)
  self[-str.length, str.length] == str
end

#start_with?(str) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/kramdown/compatibility.rb', line 39

def start_with?(str)
  self[0, str.length] == str
end