# encoding: utf-8 # String class String # Underline a string # # @param [String] character ('-') # The character used to underline the string # # @return [String] # The string + underline def underline(character: '-') result = [] result << self result << gsub(/./, character) result.join("\n") end end