Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    $str2 =~ s/([\0\1\2])/('\t', '\s', "\\n\n")[ord($1)]/ge;
    print $str."\n";
    print $str2;
    
  2. or download this
        this is a sample string
    with various white space characters
    
    \tthis\sis\sa\ssample\sstring\n
    with\svarious\swhite\sspace\scharacters\n