Skip to content

Conformance Examples 0.1.0 — Transforms: transform-lstrip

lstrip-leading-spaces

Leading ASCII whitespace is removed; trailing whitespace is preserved.

Template

[{{ phrase | lstrip }}]

Context

{
    "phrase": "   hello  "
}

Output

[hello  ]

lstrip-only-whitespace

An all-whitespace string becomes empty.

Template

[{{ phrase | lstrip }}]

Context

{
    "phrase": "    "
}

Output

[]

lstrip-newlines-and-tabs

Leading tabs and newlines are removed.

Template

[{{ phrase | lstrip }}]

Context

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

Output

[hello]

lstrip-empty-string

Empty input stays empty.

Template

[{{ phrase | lstrip }}]

Context

{
    "phrase": ""
}

Output

[]

lstrip-chained-after-downcase

Composes with another transform.

Template

[{{ phrase | downcase | lstrip }}]

Context

{
    "phrase": "   HELLO"
}

Output

[hello]

Source fixture: transforms/transform-lstrip.json