STRIM$ function

Purpose: STRIM$ strips redundant space characters from a string. Spaces at the left and right ends of the string are removed. Multiple spaces between words in the string are reduced to one space.


 Syntax:

 RetStr$ = STRIM$(MainStr$)

 Parameters:

  • MainStr$ is a string to be stripped of redundant space characters.

 Return Value:

  • RetStr$, the return value, is MainStr$ stripped of redundant space characters. Spaces at the left and right ends of the string are removed. Multiple spaces between words in the string are reduced to one space.

Example:


 DIM RetStr$

 RetStr$ = STRIM$(" 1   2        3          4 ")

 PRINT RetStr$

Result:

1 2 3 4