BLANKSTRIP

The BLANKSTRIP function removes leading or trailing blank spaces from text values. BLANKSTRIP is useful for such purposes as removing unwanted blank spaces from fixed-length fields in an imported worksheet.

Return Value

TEXT or NTEXT

Syntax

BLANKSTRIP(text-expression[TRAILING|LEADING|BOTH])

Arguments

text-expression

A text expression from which to remove blank spaces. When you specify a TEXT expression, the return value is TEXT. When you specify an NTEXT expression, the return value is NTEXT.

TRAILING

Removes blank spaces at the end of the text.

LEADING

Removes blank spaces at the beginning of the text.

BOTH

Removes both leading and trailing spaces.

Examples

Example 8-30 Stripping Leading and Trailing Blanks

In this example, we remove both leading and trailing blank spaces from the field prodlabel in an imported worksheet and store the results in a variable called product.