String::Rexx - Perl implementation of Rexx string functions
use String::Rexx qw( :all ); use String::Rexx qw( functions... );
This module implements almost all string functions of regina2-rexx .
Return 1 if string $short is a shortcut for string $long. And optionally, $len must not be greater than what the number of charecters matched with string $shoft. Otherwise, return 0.
Counts the number of occurences of 'pat' within 'string'
Returns a string of length len, with the proper padding so that 'string' is centered
Changes all instances of substing 'old' inside 'string' to the new string 'new'
Returns 0 when both strings are equal, or N when they are not. The number N denotes the length of either string -- strings are always compared after padding, so they always have equal length when they are compared. If the comparison fails, and the string contents are unequal, it will return N, the size of either string since by now hey both have the same length. The default pad character is space , ' ' .
Returns a string consisting of N concatenated copies. N = 0, 1, 2, ...
Deletes the substring which starts at $start. Length defaults to the rest of string.
Deletes $length words, starting from $start. Length defaults to the rest of string.
Returns the error string that describes the error number N .
When 'string' represents a number or a non-number literal, this fuction returns 'NUM' or 'LIT', respectively. Option can be either 'NUM' or 'LIT'; when specified, the fuction returns 1 (true) or 0 (false) depending whether 'string' is a NUM or a LIT . If the user-supplied option is neither NUM or LOT, the return value is set to undef ;
Same as chr(N) . Converts decimal N to its char in the character set.
Converts decimal N to a hex string of size $lenght .
Inserts string 'source' into string 'targer'. Position defaults to 0, length defaults to len of $source , and padding char defaults to ' ' .
Returns the position of $needle in $haystack (searching from the end) . Returns 0 if not found, and 1 when neelde occurs at start of haystack
Returns the leftmost $length chars. If there are not enough characters, the string is padded (prepended) with char characters. Char defaults to space.
Returns the length of string.
Overstrikes the $target string, with $source .
Reverses the order of characters in string.
Returns the position of $needle in $haystack . Returns 0 if not found, and 1 when neelde occurs at start of haystack
Returns the $length chars from the end of string. If there are not enough characters, the string is padded (prepended) with char characters. Char defaults to space.
After removing leading and trailing spaces, internal whitespace change to $length chars. Char defaults to ' ' , and length defaults to 1 .
Strips leading whitespace from string. The optional 2nd param can be set to 'leading', 'trailing', or 'both' . The optional 3rd param will strip chars instead of whitespace. Returns the striped string.
Returns a substring of string. If string does not have enough chars to fill the request, we use padding with character padchar .
Returns the index in the string for the Nth word.
Returns the length of the Nth word in the string. Where N=1,2,... Returns 0 if there are less worlds than N . Raises exception if is N < 1
Returns a string of words staring from start. N denotes how many words to return (default is as many as possible.) start = N = 1,2,...
The translitaration oparator. It returns a strings where all characters in 'old' and transformed to the corresponding characters in 'new' . In the special case when all options are absent, it translates $string to upper case.
Returns 0 if $string consists from characters in the set $chars , otherwise it returns the position of the 1st character in $sting that failed the match. The sense param is either 'M' for match, or 'N' for non-match, default is 'M' . The start param indicate the position from 'string' to start matching (default is 1, to match from the start of 'string').
Returns the position of the word in 'string' containing 'pattern'
Returns the nth word in the string.
Returns the number of words in the string.
Retruns a sequence of characters, starting with char S, and ending with char E .
None by default.
Ioannis Tambouras, <email@example.com>