Trim

Trim whitespace from the beginning and end of a string

Method Signature

Trim(string=[string])

Arguments

Argument
Type
Required
Description
Default

string

string

true

The string to trim

Examples

Trim

Run Example

">" & trim( "    BLDocs    " ) & "<";

Result: >BLDocs<

Additional Examples

Run Example

// create variable with a string of text that has leading and trailing spaces
foo = " Hello World!  ";
// output variable
writeDump( "-" & foo & "-" );
// output variable without leading and trailing spaces
writeDump( "-" & Trim( foo ) & "-" );

Last updated

Was this helpful?