From: Gavin Sinclair Date: 2003-10-28T17:32:13+09:00 Subject: Formatting (ANSI) highlighted strings Hi folks, Using the 'text/highlight' package on RubyForge, you can emit coloured strings to the console like so: s = "string".bold.red.on_white Great. Now if I want to format that using: printf "%-10s goes here\n", s I'm not going to get (in B&W) string goes here Rather string goes here Because s.size > 10 # It contains escape sequences to enact colours. even though it only contains 6 printable characters. So, I don't think there's any way I can use printf to do this kind of formatting (modifying s.size doesn't change anything). Does anyone have any alternative, or a bright idea? Thanks, Gavin