Trim()
Removes leading and trailing spaces from a string.
Trim( string=string );
Returns: String
| Argument | Description |
|---|---|
|
string
string,
required
|
edit
the string to trim |
Examples
edit // 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) & "-");
See also
- Strings
- LTrim()
- RTrim()
- TrimWhitespace()
- string.trim()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)