$return = trim(string[,trimCharacter[,LEFT | RIGHT]])
Where:
$return | the trimmed string. |
string | text to be trimmed. |
trimCharacter | the leading and/or trailing character(s) to trim from string. If this parameter contains multiple characters all of the occurrences of these character will be trimmed. If trimCharacter is not specified, then it defaults to a space character. This parameter may be a variable containing the trim character or characters. Enclose trimCharacter in double quotation marks ("") if it contains spaces or commas. |
LEFT | trim leading characters from string. If neither LEFT or RIGHT is specified, then both leading and trailing characters are trimmed. |
RIGHT | trim trailing characters from string. |
The trim command trims leading and/or trailing characters from a variable.
Example
$return = trim($text)
$return = trim($text,0,left)
$return = trim($text," ", right)
$return = trim($text,"$ ")
Sample Script
' trim.txt
' Trim trailing zeros.
$text = "985.2000000"
$return = trim($text,"0",Right)
MsgBox($return)
exit
See Also:
TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.