TRIM$()

TRIM$(S)

RETURNS THE STRING REMOVING LEADING AND TRAILING SPACES FROM THE STRING S

  • Type: Function
  • Parameter: 1
  • Group: Strings

ACTION

The function TRIM$(S) returns the string removing leading and trailing spaces from the string S.

Remark: the keyword TRIM$ ends by '$' : it means that the returned value is a string.

SYNTAX: Result$=TRIM$(S)

  • S = string expression.
  • Result$ is a string.

USE

  • The function TRIM$() is used to remove leading and trailing spaces from a string.

ERROR

  • If S is not a correct string expression.

EXAMPLE

print "->"+trim$(" abc ")+"<-"

print "->abc<-"

SEE ALSO

INSERT$()

INSTR()

LEFT$()

LEN()

LOWER$()

LTRIM$()

MID$()

RIGHT$()

RTRIM$()

STR$()

STRING$()

UPPER$()