remove nonprintable characters
def printable(str) return "" unless str eval(str.strip.dump.gsub(/\\[0-9]{3}/,'')) end
DZone Snippets > kelyar > nonprintable
11391 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Kelyarsky Evgeniy http://payplay.fm
def printable(str) return "" unless str eval(str.strip.dump.gsub(/\\[0-9]{3}/,'')) end