Liking cljdoc? Tell your friends :D

hara.string


=clj

(= 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
raw docstring

blank?clj

(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
raw docstring

camel-caseclj

(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
raw docstring

capital-caseclj

(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
raw docstring

capital-sep-caseclj

(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"
raw docstring

caseless=clj

(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
raw docstring

copy-string-varclj

(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
raw docstring

ends-with?clj

(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
raw docstring

formatclj

(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
raw docstring

from-stringclj

(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)
raw docstring

includes?clj

(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
raw docstring

joinclj

(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
raw docstring

joinlclj

(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
raw docstring

lower-caseclj

(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
raw docstring

lower-sep-caseclj

(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")
raw docstring

pascal-caseclj

(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
raw docstring

path-countclj

(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
raw docstring

path-joinclj

(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
raw docstring

path-nsclj

(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
raw docstring

path-ns-arrayclj

(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]
raw docstring

path-nthclj

(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"
raw docstring

path-rootclj

(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
raw docstring

path-separatorclj

(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)
=> "/"
raw docstring

path-splitclj

(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]
raw docstring

path-stemclj

(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
raw docstring

path-stem-arrayclj

(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]
raw docstring

path-subclj

(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
raw docstring

path-sub-arrayclj

(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]
raw docstring

path-valclj

(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
raw docstring

phrase-caseclj

(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"
raw docstring

replaceclj

(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
raw docstring

reverseclj

(reverse s)

reverses the string

(reverse "hello") => "olleh"

(string/reverse :hello) => :olleh

reverses the string

(reverse "hello")
=> "olleh"

(string/reverse :hello)
=> :olleh
raw docstring

snake-caseclj

(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
raw docstring

spear-caseclj

(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
raw docstring

splitclj

(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]
raw docstring

split-linesclj

(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"]
raw docstring

starts-with?clj

(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
raw docstring

subsclj

(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.
raw docstring

to-stringclj

(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"
raw docstring

trimclj

(trim s)

trims the string of whitespace

(trim " hello ") => "hello"

trims the string of whitespace

(trim "   hello   ")
=> "hello"
raw docstring

trim-leftclj

(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   "
raw docstring

trim-newlinesclj

(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   "
raw docstring

trim-rightclj

(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"
raw docstring

typeless=clj

(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
raw docstring

upper-caseclj

(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
raw docstring

upper-sep-caseclj

(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"
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close