(blank? s)
checks if string is empty or nil
(blank? nil) => true
(blank? "") => true
checks if string is empty or nil (blank? nil) => true (blank? "") => true
(capital-case s)
converts a string object to capital case
(capital-case "hello.World") => "Hello.world"
(string/capital-case 'hello.World) => 'Hello.world
converts a string object to capital case (capital-case "hello.World") => "Hello.world" (string/capital-case 'hello.World) => 'Hello.world
(caseless= x y)
compares two values ignoring case
(caseless= "heLLo" "HellO") => true
(string/caseless= 'heLLo :HellO) => true
compares two values ignoring case (caseless= "heLLo" "HellO") => true (string/caseless= 'heLLo :HellO) => true
(ends-with? s substr)
checks if string ends with another
(ends-with? "hello" "lo") => true
(string/ends-with? 'hello 'lo) => true
checks if string ends with another (ends-with? "hello" "lo") => true (string/ends-with? 'hello 'lo) => true
(includes? s substr)
checks if first string contains the second
(includes? "hello" "ell") => true
(string/includes? 'hello 'ell) => true
checks if first string contains the second (includes? "hello" "ell") => true (string/includes? 'hello 'ell) => true
(join coll)
(join seperator coll)
like join
but used with ->>
opts
(join "." ["a" "b" "c"]) => "a.b.c"
(string/join "." '[a b c]) => 'a.b.c
like `join` but used with `->>` opts (join "." ["a" "b" "c"]) => "a.b.c" (string/join "." '[a b c]) => 'a.b.c
(joinl coll)
(joinl coll separator)
joins an array using a separator
(joinl ["a" "b" "c"] ".") => "a.b.c"
(joinl ["a" "b" "c"]) => "abc"
(string/joinl [:a :b :c] "-") => :a-b-c
joins an array using a separator (joinl ["a" "b" "c"] ".") => "a.b.c" (joinl ["a" "b" "c"]) => "abc" (string/joinl [:a :b :c] "-") => :a-b-c
(lower-case s)
converts a string object to lower case
(lower-case "Hello.World") => "hello.world"
(string/lower-case 'Hello.World) => 'hello.world
converts a string object to lower case (lower-case "Hello.World") => "hello.world" (string/lower-case 'Hello.World) => 'hello.world
(replace s match replacement)
replace value in string with another
(replace "hello" "el" "AL") => "hALlo"
(string/replace :hello "el" "AL") => :hALlo
replace value in string with another (replace "hello" "el" "AL") => "hALlo" (string/replace :hello "el" "AL") => :hALlo
(reverse s)
reverses the string
(reverse "hello") => "olleh"
(string/reverse :hello) => :olleh
reverses the string (reverse "hello") => "olleh" (string/reverse :hello) => :olleh
(split s re)
splits the string into tokens
(split "a b c" #" ") => ["a" "b" "c"]
(string/split :a.b.c (re-pattern ".")) => [:a :b :c]
splits the string into tokens (split "a b c" #" ") => ["a" "b" "c"] (string/split :a.b.c (re-pattern "\.")) => [:a :b :c]
(split-lines s)
splits the string into separate lines
(split-lines "a\nb\nc") => ["a" "b" "c"]
splits the string into separate lines (split-lines "a\nb\nc") => ["a" "b" "c"]
(starts-with? s substr)
checks if string starts with another
(starts-with? "hello" "hel") => true
(string/starts-with? 'hello 'hel) => true
checks if string starts with another (starts-with? "hello" "hel") => true (string/starts-with? 'hello 'hel) => true
(trim s)
trims the string of whitespace
(trim " hello ") => "hello"
trims the string of whitespace (trim " hello ") => "hello"
(trim-left s)
trims the string of whitespace on left
(trim-left " hello ") => "hello "
trims the string of whitespace on left (trim-left " hello ") => "hello "
(trim-newlines s)
removes newlines from right
(trim-newlines "\n\n hello \n\n") => "\n\n hello "
removes newlines from right (trim-newlines "\n\n hello \n\n") => "\n\n hello "
(trim-right s)
trims the string of whitespace on right
(trim-right " hello ") => "hello"
trims the string of whitespace on right (trim-right " hello ") => "hello"
(upper-case s)
converts a string object to upper case
(upper-case "hello-world") => "HELLO-WORLD"
(string/upper-case :hello-world) => :HELLO-WORLD
converts a string object to upper case (upper-case "hello-world") => "HELLO-WORLD" (string/upper-case :hello-world) => :HELLO-WORLD
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close