REXX String Management Functions
- CENTER(string, length[, pad]) --
- returns "string" centered in "length" and padded with the "pad" character(s), if specified (defaults to blank)
- COMPARE(string1, string2[, pad]) --
- returns "0" if "string1" and "string2" are identical
- otherwise, returns the position of the first character that does not match
- COPIES(string, n) --
- returns "n" copies of "string"
- DATATYPE(string[, type]) --
- if only "string" is specified, returns either "NUM" ("string" is a valid REXX number) or "CHAR"
- when "type" is specified, returns "1" if "string" is of that type or "0" if it is not
- there are 11 possible "type" values
- DATE([option]) --
- returns the current date in the format specified by "option"
- if "option" is omitted, returns "dd Mon yyyy"
- LEFT(string, length[, pad]) --
- returns the left portion of "string" to "length" size
- "string" is truncated to "length" if necessary, or padded with the "pad" character
- LENGTH(string) --
- returns the length of "string"
- RIGHT(string, length[, pad]) --
- returns the right portion of "string" to "length" size
- "string" is truncated to "length" if necessary or padded with the "pad" character
- SPACE(string[, [n][, pad]]) --
- returns "string" formatted with "n" "pad" characters between each word
- STRIP(string[, [option][, char]]) --
- returns a copy of "string" with leading, trailing or both leading and trailing "char" characters removed
- "char" defaults to a blank; "option" defaults to both
- SUBSTR(string, n[, [length][, pad]]) --
- returns a substring of "string" beginning at character "n" and "length" characters long
- the returned string is padded with "pad" if necessary
- SUBWORD(string, n[, length]) --
- returns a substring of "string" beginning at word "n" and up to "length" words long
- TIME([option]) --
- returns the local time as HH:MM:SS or in the format specified by "option"
- "option" can be one of eight values
- TRANSLATE(string[, [table_out][, [table_in][, pad]]]) --
- returns "string" with the characters in "string" specified in "table_in" translated to the corresponding characters (by position) in "table_out"
>li>"table_out" is padded with the "pad" character as needed
- WORD(string, n) --
- returns the "n"th blank-delimited word in "string"
- WORDPOS(phrase, string) --
- returns the word number of the first occurrence of "phrase" in "string"
- WORDS(string) --
- returns the number of words in "string"
- returns "0" if "string" is nil or consists only of spaces
<.ul>
Next