StringTrimTest
`String.trim`, `String.trimLeft` and `String.trimRight` remove whitespace from both ends, the start only and the end only of `" hello "`.
Results
elm-0.19.1
passran in 78 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. trim1: "hello" trimLeft1: "hello " trimRight1: " hello"
elm-0.19.2
passran in 43 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. trim1: "hello" trimLeft1: "hello " trimRight1: " hello"
elm-0.19.3
passran in 80 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. trim1: "hello" trimLeft1: "hello " trimRight1: " hello"
lamdera-1.5.0
passran in 41 msOutput
trim1: "hello" trimLeft1: "hello " trimRight1: " hello"
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/StringTrimTest] in its title.
Source
The -- CHECK: lines give the expected output.
module StringTrimTest exposing (main)
{-| `String.trim`, `String.trimLeft` and `String.trimRight` remove whitespace
from both ends, the start only and the end only of `" hello "`.
-}
-- CHECK: trim1: "hello"
-- CHECK: trimLeft1: "hello "
-- CHECK: trimRight1: " hello"
import Html exposing (text)
main =
let
_ = Debug.log "trim1" (String.trim " hello ")
_ = Debug.log "trimLeft1" (String.trimLeft " hello ")
_ = Debug.log "trimRight1" (String.trimRight " hello ")
in
text "done"