A bunch of utility functions for strings
A bunch of utility functions for strings
(prepare-for-compare s)
(prepare-for-compare s {:keys [upper-case? coerce?]})
Takes a string s
trims it and coerces it to lower case.
Since the mapping between upper and lower case characters isn't perfect for every language,
an option flag :upper-case?
may be passed to coerce in the other direction.
To cast non-strings to strings, the coerce?
flag may also be passed.
Takes a string `s` trims it and coerces it to lower case. Since the mapping between upper and lower case characters isn't perfect for every language, an option flag `:upper-case?` may be passed to coerce in the other direction. To cast non-strings to strings, the `coerce?` flag may also be passed.
(string-compare s1 s2)
(string-compare s1 s2 opts)
Compares s1
and s2
as lower-case, trimmed strings.
Since the mapping between upper and lower case characters isn't perfect for every language,
an option flag :upper-case?
may be passed to coerce in the other direction.
To cast non-strings to strings, the coerce?
flag may also be passed.
Compares `s1` and `s2` as lower-case, trimmed strings. Since the mapping between upper and lower case characters isn't perfect for every language, an option flag `:upper-case?` may be passed to coerce in the other direction. To cast non-strings to strings, the `coerce? `flag may also be passed.
(string-includes? s1 s2)
(string-includes? s1 s2 opts)
Checks to see if s1
contains s2
as lower-case, trimmed strings.
Since the mapping between upper and lower case characters isn't perfect for every language,
an option flag :upper-case?
may be passed to coerce in the other direction.
To cast non-strings to strings, the coerce?
flag may also be passed.
Checks to see if `s1` contains `s2` as lower-case, trimmed strings. Since the mapping between upper and lower case characters isn't perfect for every language, an option flag `:upper-case?` may be passed to coerce in the other direction. To cast non-strings to strings, the `coerce? `flag may also be passed.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close