Liking cljdoc? Tell your friends :D

cases.core

Case handling transducers for strings.

Case handling transducers for strings.
raw docstring

capitalizeclj

(capitalize)
(capitalize s)

Capitalize only the first letter of s or return a transducer to do this.

All other characters will be lower case. Unlike the Clojure and Python capitalization functions, leading non-letter characters, such as spaces, are skipped. Title case is used, rather than upper case.

(capitalize " the United Kingdom (UK) or Britain, is a country ")
;; => " The united kingdom (uk) or britain, is a country "
Capitalize only the first letter of `s` or return a transducer to do this.

All other characters will be lower case. Unlike the Clojure and Python
capitalization functions, leading non-letter characters, such as spaces,
are skipped. Title case is used, rather than upper case.

```clojure
(capitalize " the United Kingdom (UK) or Britain, is a country ")
;; => " The united kingdom (uk) or britain, is a country "
```
raw docstring

capitalize-firstclj

(capitalize-first)
(capitalize-first s)

Capitalize only the first letter of s or return a transducer to do this.

All other characters will be left as-is. Leading non-letter characters, such as spaces, are skipped. Title case is used, rather than upper case.

(capitalize-first " the United Kingdom (UK) or Britain, is a country ")
;; => " The United Kingdom (UK) or Britain, is a country "
Capitalize only the first letter of `s` or return a transducer to do this.

All other characters will be left as-is. Leading non-letter characters, such
as spaces, are skipped. Title case is used, rather than upper case.

```clojure
(capitalize-first " the United Kingdom (UK) or Britain, is a country ")
;; => " The United Kingdom (UK) or Britain, is a country "
```
raw docstring

capitalize-wordsclj

(capitalize-words)
(capitalize-words s)

Capitalizes space-separated words or returns a transducer for this.

Matches Python's default string.capcase() function except that whitespace is not compressed automatically.

(capitalize-words " 1aa  bb2cc ")
;; => " 1aa  Bb2cc "
Capitalizes space-separated words or returns a transducer for this.

Matches Python's default `string.capcase()` function except that whitespace
is not compressed automatically.

```clojure
(capitalize-words " 1aa  bb2cc ")
;; => " 1aa  Bb2cc "
```
raw docstring

compress-whitespaceclj

(compress-whitespace)
(compress-whitespace s)

Squeezes whitespace to one character or returns a transducer for this.

The first whitespace character matched each time is kept. Matches are made according to Character/isWhitespace.

(compress-whitespace "  a  
b 
c
")
;; => " a b c
"
Squeezes whitespace to one character or returns a transducer for this.

  The first whitespace character matched each time is kept. Matches are made
  according to `Character/isWhitespace`.
  ```clojure
  (compress-whitespace "  a  
b 
 c
  ")
  ;; => " a b c
"
  ```
raw docstring

lower-caseclj

(lower-case)
(lower-case s)

Convert every character to lower case, or return a lower-case transducer.

Convert every character to lower case, or return a lower-case transducer.
raw docstring

string-buildclj

(string-build rf s)

String builder reduction of the application of rf to string s.

String builder reduction of the application of `rf` to string `s`.
raw docstring

titleclj

(title)
(title s)

Converts a string to title case or returns a stateful transducer to do this.

Uses (but possibly doesn't fully match) the broad Python definition that the beginning of a word is considered to be any letter that isn't preceded by another letter. The first letter is converted using Character/toTitleCase.

(title "they're bill's friends from the UK")
;; => "They'Re Bill'S Friends From The Uk"
Converts a string to title case or returns a stateful transducer to do this.

Uses (but possibly doesn't fully match) the broad Python definition that the
beginning of a word is considered to be any letter that isn't preceded by
another letter. The first letter is converted using `Character/toTitleCase`.

```clojure
(title "they're bill's friends from the UK")
;; => "They'Re Bill'S Friends From The Uk"
```
raw docstring

title-caseclj

(title-case)
(title-case s)

Convert every character to title case, or return a title-case transducer.

Convert every character to title case, or return a title-case transducer.
raw docstring

trimclj

(trim)
(trim s)

Trim whitespace around a string or returns a transducer to do this.

(trim "
A
")
;; => "A"
Trim whitespace around a string or returns a transducer to do this.

```clojure
(trim "
A
")
;; => "A"
```
raw docstring

trim-newlineclj

(trim-newline)
(trim-newline s)

Trim newlines at the end of a string or return a transducer for this.

Newline characters are either or .

(trim-newline "
a b c


")
;; => "
a b c"
Trim newlines at the end of a string or return a transducer for this.

  Newline characters are either `
` or `
`.

  ```clojure
  (trim-newline "
a b c


")
  ;; => "
a b c"
  ```
raw docstring

trimlclj

(triml)
(triml s)

Trims whitespace from from the left of a string or a transducer for this.

(triml " 
A
")
;; => "A
"
Trims whitespace from from the left of a string or a transducer for this.

  ```clojure
  (triml " 
 
A
")
  ;; => "A
"
  ```
raw docstring

trimrclj

(trimr)
(trimr s)

Trims whitespace from from the right of a string or a transducer for this.

(trimr " 
A
")
;; => " 
A"
Trims whitespace from from the right of a string or a transducer for this.

  ```clojure
  (trimr " 
 
A
")
  ;; => " 
 
A"
  ```
raw docstring

upper-caseclj

(upper-case)
(upper-case s)

Convert every character to upper case, or return an upper-case transducer.

Convert every character to upper case, or return an upper-case transducer.
raw docstring

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

× close