Skip to content

Conformance Examples 0.1.0 — Transforms: transform-rstrip

rstrip-trailing-spaces

Trailing ASCII whitespace is removed; leading whitespace is preserved.

Template

[{{ phrase | rstrip }}]

Context

{
    "phrase": "  hello   "
}

Output

[  hello]

rstrip-only-whitespace

An all-whitespace string becomes empty.

Template

[{{ phrase | rstrip }}]

Context

{
    "phrase": "    "
}

Output

[]

rstrip-newlines-and-tabs

Trailing tabs and newlines are removed.

Template

[{{ phrase | rstrip }}]

Context

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

Output

[hello]

rstrip-empty-string

Empty input stays empty.

Template

[{{ phrase | rstrip }}]

Context

{
    "phrase": ""
}

Output

[]

rstrip-chained-after-upcase

Composes with another transform.

Template

[{{ phrase | upcase | rstrip }}]

Context

{
    "phrase": "hello    "
}

Output

[HELLO]

Source fixture: transforms/transform-rstrip.json