Home
Perl
Array
CGI
Class
Data Type
Database
File
GUI
Hash
Language Basics
Network
Regular Expression
Report
Statement
String
Subroutine
System Functions
Win32
XML
Menu
tr « Regular Expression « Perl
Perl
Regular Expression
tr
1.
Counting using tr.
2.
$text =~ tr/a-z/d-za-c/;
3.
$text =~ tr/d-za-c/a-z/;
4.
Using tr to count the occurrences of specific characters.
5.
Using tr to retrieve the length of a string.
6.
tr/a-z/A-Z/
7.
tr/i/o/;
8.
tr/o/i/;