IB Statements/strip

From CometWiki

< IB Statements
Revision as of 11:29, 22 May 2009 by Badge (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

STRIP function

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.

See STRIPL and STRIPR.

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 OPTION$
IF STRIP(OPTION$) = "Y" THEN GOTO SectionTwo

In this example, the variable OPTION$ is used to receive input from the video screen. 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 label SectionTwo.

Personal tools