character cast by Perl
paul
posted @ Thu, 18 Sep 2008 07:03:12 +0800
in coding life
with tags
Perl
, 1851 readers
uppercase cast:
perl -p -e 's/(lowercase pattern)/\u$1/g'
perl -n -e 'print "\U$_"'
perl -p -e '$_="\U$_"'
lowercase cast:
perl -p -e 's/(uppercase pattern)/\l$1/g'
perl -n -e 'print "\L$_"'
perl -p -e '$_="\L$_"'
This work is licensed under a Creative Commons Attribution 3.0 Unported License.