lib/wiki/extensions.rb
# Return the last n lines of the string
Return the last n lines of the string
Return the last n lines of the string
def last_lines(n)
    lines = split("\n")
    if lines.length <= n
      self
    else
      lines[-n..-1].join("\n")
    end
  end
def last_lines ( n ) lines = split ( "\n" ) if lines . length <= n self else lines [ - n .. - 1 ] . join ( "\n" ) end end
Return the last n lines of the string
Return the last n lines of the string
n
<not_specific>