std.string.prose
escape-dollars
added in 3.0
(escape-dollars s)for regex purposes, escape dollar signs in strings
(escape-dollars “$”) => string?
escape-escapes
added in 3.0
(escape-escapes s)makes sure that newlines are printable
(escape-escapes "
") => "\ "
escape-newlines
added in 3.0
(escape-newlines s)makes sure that newlines are printable
(escape-newlines "
") => "
"
escape-quotes
added in 3.0
(escape-quotes s)makes sure that quotes are printable in string form
(escape-quotes “"hello"”) => “\“hello\””
filter-empty-lines
added in 3.0
(filter-empty-lines s)filter empty line
(filter-empty-lines (common/join “\n” [“a” " " " " “b”])) => “a\nb”
has-quotes?
added in 3.0
(has-quotes? s)checks if a string has quotes
(has-quotes? “"hello"”) => true
indent
added in 4.0
(indent block n & [{:keys [custom], :or {custom ""}}])indents a block of string
(indent (write-lines “a” “b” “c”) 2) => “a\n b\n c”
indent-rest
added in 4.0
(indent-rest block n & [{:keys [custom], :or {custom ""}}])indents the rest of the boiy
(indent-rest (write-lines “a” “b” “c”) 2) => “a\n b\n c”
join-lines
added in 4.0
(join-lines arr)join non empty elements in array
(join-lines "" “hello” “world”) => “helloworld”
layout-lines
added in 4.0
(layout-lines tokens)(layout-lines tokens max)layout tokens in lines depending on max length
(layout-lines “hello” “world” “again” “a” “b” 8) => “hello\nworld\nagain a\nb”
lines
added in 3.0
(lines s)transforms string to seperated newlines
(lines “abc\ndef”) => ’(std.string.prose/| “abc” “def”)
strip-quotes
added in 3.0
(strip-quotes s)gets rid of quotes in a string
(strip-quotes “"hello"”) => “hello”
whitespace?
added in 3.0
(whitespace? s)checks if the string is all whitespace
(whitespace? " ") => true