Trim()

Syntax

Result$ = Trim(String$ [, Character$])
Description
Removes all the specified characters located at the beginning and at the end of a string.

Parameters

String$ The string to trim.
Character$ (optional) The character used to trim the string. The default character is 'space'. 'Character$' has to be a one character length string.

Return value

A new string holding the original string without the removed characters.

Example

  Debug Trim("   Hello     ")  ; Will display "Hello"
  Debug Trim("!!Hello!!", "!") ; Will display "Hello"

See Also

LTrim(), RTrim()

Supported OS

All

<- StringField() - String Index - UCase() ->