Overview
ANSI escape codes can be used to output bold text in the console. Please note that
- In MAC/Linux system terminal supports ANSI escape codes
- Windows Command Prompt doesn’t support it. On windows, you can install Cygwin. ANSI escape codes work on that.
Program
class String
def italic
"\e[3m#{self}\e[23m"
end
end
puts "Italic String".italic
Output