(= x y)
compares two string-like things
(string/= :a 'a) => true
(string/= ns :hara.string-test) => true
compares two string-like things (string/= :a 'a) => true (string/= *ns* :hara.string-test) => true
(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
(camel-case value)
converts a string-like object to camel case representation
(camel-case "hello-world") => "helloWorld"
(string/camel-case 'hello_world) => 'helloWorld
converts a string-like object to camel case representation (camel-case "hello-world") => "helloWorld" (string/camel-case 'hello_world) => 'helloWorld
(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
(capital-sep-case value)
converts a string-like object to captital case representation
(capital-sep-case "hello world") => "Hello World"
(str (string/capital-sep-case :hello-world)) => ":Hello World"
converts a string-like object to captital case representation (capital-sep-case "hello world") => "Hello World" (str (string/capital-sep-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
(copy-string-var type return ns name source)
creates a function, augmenting it with string conversion properties
(string/copy-string-var :op false ns '-subs- #'string/subs) => #'hara.string-test/-subs-
(-subs- :hello 3) => :lo
(-subs- :hello 1 4) => :ell
creates a function, augmenting it with string conversion properties (string/copy-string-var :op false *ns* '-subs- #'string/subs) => #'hara.string-test/-subs- (-subs- :hello 3) => :lo (-subs- :hello 1 4) => :ell
(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
(format fmt & args)
Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax
Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax
(from-string string type)
(from-string string type opts)
converts a string to an object
(from-string "a" clojure.lang.Symbol) => 'a
(from-string "hara.string" clojure.lang.Namespace) => (find-ns 'hara.string)
converts a string to an object (from-string "a" clojure.lang.Symbol) => 'a (from-string "hara.string" clojure.lang.Namespace) => (find-ns 'hara.string)
(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 arr)
(join sep arr)
joins a list together
(string/join "." [:a :b :c]) => :a.b.c
joins a list together (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
(lower-sep-case value)
converts a string-like object to a lower case representation
(lower-sep-case "helloWorld") => "hello world"
(string/lower-sep-case 'hello-world) => (symbol "hello world")
converts a string-like object to a lower case representation (lower-sep-case "helloWorld") => "hello world" (string/lower-sep-case 'hello-world) => (symbol "hello world")
(pascal-case value)
converts a string-like object to a pascal case representation
(pascal-case "helloWorld") => "HelloWorld"
(string/pascal-case :hello-world) => :HelloWorld
converts a string-like object to a pascal case representation (pascal-case "helloWorld") => "HelloWorld" (string/pascal-case :hello-world) => :HelloWorld
(path-count s)
(path-count s sep)
counts the number of elements in a given path
(path/path-count "a/b/c") => 3
(string/path-count ns) => 4
counts the number of elements in a given path (path/path-count "a/b/c") => 3 (string/path-count *ns*) => 4
(path-join arr)
(path-join arr sep)
joins a sequence of elements into a path separated value
(path/path-join ["a" "b" "c"]) => "a/b/c"
(string/path-join '[:a :b :c] "-") => :a-b-c
(string/path-join '[a b c] '-) => 'a-b-c
joins a sequence of elements into a path separated value (path/path-join ["a" "b" "c"]) => "a/b/c" (string/path-join '[:a :b :c] "-") => :a-b-c (string/path-join '[a b c] '-) => 'a-b-c
(path-ns s)
(path-ns s sep)
returns the path namespace of the string
(path/path-ns "a/b/c/d") => "a/b/c"
(string/path-ns :a.b.c ".") => :a.b
returns the path namespace of the string (path/path-ns "a/b/c/d") => "a/b/c" (string/path-ns :a.b.c ".") => :a.b
(path-ns-array s)
(path-ns-array s sep)
returns the path vector of the string
(path/path-ns-array "a/b/c/d") => ["a" "b" "c"]
(string/path-ns-array (keyword "a/b/c/d")) => [:a :b :c]
returns the path vector of the string (path/path-ns-array "a/b/c/d") => ["a" "b" "c"] (string/path-ns-array (keyword "a/b/c/d")) => [:a :b :c]
(path-nth s n)
(path-nth s n sep)
check for the val of the string
(path/path-nth "a/b/c/d" 2) => "c"
check for the val of the string (path/path-nth "a/b/c/d" 2) => "c"
(path-root s)
(path-root s sep)
returns the path root of the string
(path/path-root "a/b/c/d") => "a"
(string/path-root 'a.b.c ".") => 'a
returns the path root of the string (path/path-root "a/b/c/d") => "a" (string/path-root 'a.b.c ".") => 'a
(path-separator type)
returns the default path separator for an object
(path-separator clojure.lang.Namespace) => "."
(path-separator clojure.lang.Keyword) => "/"
returns the default path separator for an object (path-separator clojure.lang.Namespace) => "." (path-separator clojure.lang.Keyword) => "/"
(path-split s)
(path-split s sep)
splits a sequence of elements into a path separated value
(path/path-split "a/b/c/d") => '["a" "b" "c" "d"]
(path/path-split "a.b.c.d" ".") => ["a" "b" "c" "d"]
(string/path-split :hello/world) => [:hello :world]
(string/path-split :hello.world ".") => [:hello :world]
splits a sequence of elements into a path separated value (path/path-split "a/b/c/d") => '["a" "b" "c" "d"] (path/path-split "a.b.c.d" ".") => ["a" "b" "c" "d"] (string/path-split :hello/world) => [:hello :world] (string/path-split :hello.world ".") => [:hello :world]
(path-stem s)
(path-stem s sep)
returns the path stem of the string
(path/path-stem "a/b/c/d") => "b/c/d"
(string/path-stem 'a.b.c.d ".") => 'b.c.d
returns the path stem of the string (path/path-stem "a/b/c/d") => "b/c/d" (string/path-stem 'a.b.c.d ".") => 'b.c.d
(path-stem-array s)
(path-stem-array s sep)
returns the path stem vector of the string
(path/path-stem-array "a/b/c/d") => ["b" "c" "d"]
(string/path-stem-array 'a.b.c.d ".") => '[b c d]
returns the path stem vector of the string (path/path-stem-array "a/b/c/d") => ["b" "c" "d"] (string/path-stem-array 'a.b.c.d ".") => '[b c d]
(path-sub s start num)
(path-sub s start num sep)
returns a subsection of the path within the string
(path/path-sub "a/b/c/d" 1 2) => "b/c"
(string/path-sub (symbol "a/b/c/d") 1 2) => 'b/c
returns a subsection of the path within the string (path/path-sub "a/b/c/d" 1 2) => "b/c" (string/path-sub (symbol "a/b/c/d") 1 2) => 'b/c
(path-sub-array s start num)
(path-sub-array s start num sep)
returns a sub array of the path within the string
(path/path-sub-array "a/b/c/d" 1 2) => ["b" "c"]
(string/path-sub-array (symbol "a/b/c/d") 1 2) => '[b c]
returns a sub array of the path within the string (path/path-sub-array "a/b/c/d" 1 2) => ["b" "c"] (string/path-sub-array (symbol "a/b/c/d") 1 2) => '[b c]
(path-val s)
(path-val s sep)
returns the val of the string
(path/path-val "a/b/c/d") => "d"
(string/path-val 'a.b.c.d ".") => 'd
returns the val of the string (path/path-val "a/b/c/d") => "d" (string/path-val 'a.b.c.d ".") => 'd
(phrase-case value)
converts a string-like object to snake case representation
(phrase-case "hello-world") => "Hello world"
converts a string-like object to snake case representation (phrase-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
(snake-case value)
converts a string-like object to snake case representation
(snake-case "hello-world") => "hello_world"
(string/snake-case 'helloWorld) => 'hello_world
converts a string-like object to snake case representation (snake-case "hello-world") => "hello_world" (string/snake-case 'helloWorld) => 'hello_world
(spear-case value)
converts a string-like object to spear case representation
(spear-case "hello_world") => "hello-world"
(string/spear-case 'helloWorld) => 'hello-world
converts a string-like object to spear case representation (spear-case "hello_world") => "hello-world" (string/spear-case 'helloWorld) => 'hello-world
(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
(subs s start)
(subs s start end)
Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive.
Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive.
(to-string string)
converts an object to a string
(to-string :hello/world) => "hello/world"
(to-string ns) => "hara.string.base.impl-test"
converts an object to a string (to-string :hello/world) => "hello/world" (to-string *ns*) => "hara.string.base.impl-test"
(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"
(typeless= x y)
compares two representations
(typeless= "helloWorld" "hello_world") => true
(string/typeless= :a-b-c "a b c") => true
(string/typeless= 'getMethod :get-method) => true
compares two representations (typeless= "helloWorld" "hello_world") => true (string/typeless= :a-b-c "a b c") => true (string/typeless= 'getMethod :get-method) => true
(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
(upper-sep-case value)
converts a string-like object to upper case representation
(upper-sep-case "hello world") => "HELLO WORLD"
(str (string/upper-sep-case 'hello-world)) => "HELLO WORLD"
converts a string-like object to upper case representation (upper-sep-case "hello world") => "HELLO WORLD" (str (string/upper-sep-case 'hello-world)) => "HELLO WORLD"
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close