view config/initializers/ext_string.rb @ 166:469df6354341

A more robust check
author nanaya <me@nanaya.pro>
date Fri, 03 Aug 2018 02:39:09 +0900
parents 61414d0a367b
children e2150dce4e90
line wrap: on
line source

class String
  def printable
    gsub(/[^\n[:print:]]/, '')
  end
end