From: Stefan Rusterholz Date: 2008-11-10T07:54:54+09:00 Subject: Re: Formatting Ruby Text? Carter Davis wrote: > Hello. I was wondering...Is it possible to format text in Ruby besides > using the string literals like \n or \t? For example, can you make text > bold? Not sure I understand your question correctly. If you mean the source-code then you're looking for a syntax highlighting editor which doesn't touch the text at all but just highlights it. If you mean when outputting e.g. via puts then it entirely depends on your output device. If it is a terminal that supports ANSII escape sequences then you can use them. Look for the Term::ANSIColor gem on rubyforge for a convenient way to do that. Plain it is like this: puts "\e[1mBold\e[0m" puts "\e[31mRed\e[0m" With the gem you can do it like this: puts "Bold".bold puts "Red".red (iirc) Regards Stefan -- Posted via http://www.ruby-forum.com/.