Skip to content

Conformance Examples 0.1.0 — Transforms: transform-strip

strip-leading-and-trailing

Both ends are trimmed; interior whitespace is preserved.

Template

[{{ phrase | strip }}]

Context

{
    "phrase": "  hello  world   "
}

Output

[hello  world]

strip-only-whitespace

An all-whitespace string becomes empty.

Template

[{{ phrase | strip }}]

Context

{
    "phrase": "    "
}

Output

[]

strip-empty-string

Empty input stays empty.

Template

[{{ phrase | strip }}]

Context

{
    "phrase": ""
}

Output

[]

strip-tabs-and-newlines

Tabs and newlines on both ends are removed.

Template

[{{ phrase | strip }}]

Context

{
    "phrase": "\t\n hello \n\t"
}

Output

[hello]

strip-chained-into-upcase

Composes downstream.

Template

[{{ phrase | strip | upcase }}]

Context

{
    "phrase": "  hello   "
}

Output

[HELLO]

Source fixture: transforms/transform-strip.json