Documents v0.10.0 · previews run the real runtime · experimental features are marked exp

trim()

functionsince 0.10experimentalrequires runtime

The text without Unicode white space at both ends.

On this page · 8 sections+

Syntax

trim(<text>)

registry syntax: trim(text)

Parameters

textstring or keywordrequired
Numbers, booleans and datetimes are an error.

Return value

A string.

Example

trim.cssreactive
.f { --value: state(""); }.f textarea:on(input) { --value: set(trim(event(value))); }
state()Function · hover any red tokenMakes each matching element the owner of an independent state with an initial value.Reference →

Behavior

  • The result of trim(event(value)) can calculate as a number when it is exactly a decimal number, such as "09".
  • In the arguments, --name reads a state; var(--name) works too.

Supported contexts

  • :on() actions: set(lower(event(value))).
  • :when() and when() conditions: :when(includes(--a, --b)).
  • Declarations, including text:: text: length(trim(--value)).

Limitations

    Experimental · syntax may change between minor versions