trim()
functionsince 0.10experimentalrequires runtimeThe 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,
--namereads a state;var(--name)works too.
Supported contexts
:on()actions:set(lower(event(value))).:when()andwhen()conditions::when(includes(--a, --b)).- Declarations, including
text::text: length(trim(--value)).
Limitations
Related
Experimental · syntax may change between minor versions