Skip to main content

$$trim

Removes whitespaces from sides of string

Usage​

{ 
"$$trim": /* String to trim */,
"type": "BOTH" /* or START / END / INDENT / JAVA */
}
"$$trim([type]):{input}"
note

Concrete values in the usage example are default values.

Returns​

string

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimarystringYesString to trim
typeenumBOTH/ START/END/INDENT/JAVABOTHType of trimming

* Different Types of trimming​

TypeJava equivalent function
BOTH (default)String::strip()
STARTString::stripLeading()
ENDString::stripTrailing()
INDENTString::stripIndent()
JAVAString::trim()

Examples​

Input

Definition

Output

"  hello  "
"$$trim:$"
"hello"
"  hello  "
"$$trim(START):$"
"hello  "
"  hello  "
"$$trim(END):$"
"  hello"
             <html> 
<body>
<p>Hello, world</p>
</body>
</html>
"$$trim(INDENT):$"
<html>
<body>
<p>Hello, world</p>
</body>
</html>