Home > Uncategorized > Replace Non Printable Characters in PERL String

Replace Non Printable Characters in PERL String

March 26th, 2009
#replace non printable characters in the description
my %good = map {$_=>1} (9,10,13,32..126);
$description =~ s/(.)/$good{ord($1)} ? $1 : ' '/eg;

Greg Uncategorized

  1. No comments yet.
  1. No trackbacks yet.