trim: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
trim(str) | trim(str) | ||
</ | </syntaxhighlight> | ||
'''Parameter''' | '''Parameter''' | ||
{{param|str|The string that has its leading and trailing white space removed.}} | {{param|str|The string that has its leading and trailing white space removed.}} | ||
|examples= | |examples= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: ":" + trim(" this is a test") + ":"] | [r: ":" + trim(" this is a test") + ":"] | ||
[r: ":" + trim("this is a test ") + ":"] | [r: ":" + trim("this is a test ") + ":"] | ||
[r: ":" + trim(" this is a test ") + ":"] | [r: ":" + trim(" this is a test ") + ":"] | ||
</ | </syntaxhighlight> | ||
Returns | Returns | ||
:this is a test: | :this is a test: |
Latest revision as of 23:59, 14 March 2023
trim() Function
• Introduced in version 1.3b48
Returns a copy of the string that is passed in with the leading and trailing white space removed.
Usage
trim(str)
Parameter
str
- The string that has its leading and trailing white space removed.
Examples
[r: ":" + trim(" this is a test") + ":"]
[r: ":" + trim("this is a test ") + ":"]
[r: ":" + trim(" this is a test ") + ":"]
Returns
:this is a test: :this is a test::this is a test: