trim()

Read(304) Label: remove, string, blank characters,

Description:

Remove the blank characters from both ends of a string.

Syntax:

trim(s)

Note:

The function removes the blank characters on both ends of string s.

Parameters:

s

Source string from which you want to remove the blank characters

Options:

@l

Remove the spaces on the left of the string s, with the parameter being letter l

@r

Remove the spaces on the right of the string s.

The default action is to remove the spaces on both ends.

@a

Remove all extra whitespaces. If there is one or continuous whitespaces within the string, retain only one whitespace; remove the whitespaces between a character and a word, but retain the whitespaces within the quotation marks.

Return value:

String

Example:

trim(" abc ")

"abc"

trim(" a bc ")

"a bc"

trim@l(" abc def ")

"abc def "

trim@l("def abc ")

"def abc "

trim@r(" abc def ")

" abc def"

trim@r("def abc ")

"def abc"

trim@a(" a bc ")

"a bc"

trim@a("a  bc")

"a bc"

trim@a("a\'  bc\' ")

"a'  bc'"

trim@a("abc  !")

"abc!"