String Functions


StatementFunction
chop($x)Removes the last character from the string contained in $x.
eval $xEvaluates the string in $x as if it were a Perl statement.
index($string, $substring, {$skip})Returns the integer location of the first occurrence (starting from the left) within $string of $substring. The optional parameter $skip returns the first occurrence of $substring after the location specified in $skip. The index value returned is zero-based; thus, if $substring is found at the beginning of $string, the value returned is 0. If the substring is not found, -1 is returned.
length($string)Returns the length of $string.
rindex($string, $substring, {$skip})Returns the integer location of the first occurrence (starting from the right) within $string of $substring. The optional parameter $skip returns the first occurrence of $substring after the location specified in $skip.
substr($string, $start, $length)Returns a string of length $length from $string, starting at location $start.
tr/oldstring/newstring/Modifies the contents of $_ by replacing all occurrences of the character string oldstring with the character string newstring. Prior to calling the tr function, the string that is the target of the oldstring/newstring replacement should be stored in the global variable $_.C