strip_newlines(text)
Strips leading and trailing n characters from text
# File lib/rdoc/text.rb, line 114 def strip_newlines text text.gsub(/\A\n*(.*?)\n*\z/, '\1') end