# encoding: utf-8 class String def underline(character: '-') result = [] result << self result << self.gsub(/./, character) result.join("\n") end end