| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
| Syntax: | STRIP(string-argument) |
| Discussion: |
The STRIP function strips leading and trailing blanks from a
string expression. The resulting current length of the string is
adjusted accordingly.
The string-argument may be a string constant, a single-element string variable, a string array element, a string expression, or a string function. |
| Example 1: |
A$=STRIP(B$)In the above example, the data contained in string variable B$ is stripped of leading and trailing blanks. The result is moved to the string variable A$. |
| Example 2: |
INPUT (0) OPTION$ IF STRIP(OPTION$) = "Y" THEN GOTO 9000In this example, the variable OPTION$ is used to receive input from the video terminal (logical unit 0). Next, leading and trailing blanks are stripped from the variable and the result is compared to "Y". If the result equals "Y" the program branches to statement 9000. |