Description

Remove leading and trailing whitespace or specified characters from string

Syntax

trim(text, characters)

Parameters

Input ParameterTypeDescription
textstringThe string to trim.
characters (optional)stringThe characters to trim.

Return value

Type
string

Sample

ExampleResultDescription
trim(' abc ')'abc'Reomve spaces from both the ends
trim('123abc321', '123')'abc'Reomve all the mached characters from both the ends
trim('123abc321', '12')'3abc3'Reomve all the mached characters from both the ends

To view all the String functions, click here.

See Also