trim - trim leading and/or trailing characters

Return to Introduction  Previous page  Next page

trim  $variable,[trimCharacter,[,LEFT | RIGHT]]


$variablevariable containing text to be trimmed.
trimCharacterthe leading and/or trailing character(s) to trim from $variable. 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.
LEFTtrim leading characters from $variable. If neither LEFT or RIGHT is specified, then both leading and trailing characters are trimmed.
RIGHTtrim trailing characters from $variable.        



The trim command trims leading and/or trailing characters from a variable.


trim $Text," ", right
trim$TEXT,"$ "


Sample Script

* trim.txt



SetVar $Text,"985.2000000"

trim $Text,"0",Right

type $Text


TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.