8.3.12 Trim (remove leading and trailing spaces from a string)
- Purpose
-
Returns a string with both leading and trailing spaces removed.
- Syntax
Trim (String [, Option])
- Arguments
-
- String
-
Specify the string itself or a variable that stores this value.
If no leading or trailing spaces are found in the specified string, the command returns the entire string.
- Option
-
Specify the following optional value:
Value
Meaning
Twice
Remove all trailing spaces.
- Description
-
If you omit the Option argument, the Trim command returns a string with one-byte leading and trailing spaces removed.
If you specify Twice in Option, both one-byte and two-byte leading and trailing spaces are removed.
- Example
' Store "ABC DEFG" in variables string1, string2, and ' string3. Dim string1, string2, string3 string1 = Trim (" ABC DEFG ", Twice) string2 = Trim (" ABC DEFG", Twice) string3 = Trim ("ABC DEFG ", Twice)
- JP1/Script version
-
Supported from JP1/Script 05-00.