Skip to main content

clojure.string

B

  • blank?

    True if s is nil, empty, or contains only whitespace.

C

  • capitalize

    Converts first character of the string to upper-case, all other characters to lower-case.

E

  • ends-with?

    True if s ends with substr.

  • escape

    Return a new string, using cmap to escape each character ch from s as follows: If (cmap ch) is nil, append ch to the ne...

I

  • includes?

    True if s includes substr.

  • index-of

    Return index of value (string or char) in s, optionally searching forward from from-index or nil if not found.

J

  • join

    Returns a string of all elements in coll, as returned by (seq coll), separated by an optional separator.

L

  • last-index-of

    Return last index of value (string or char) in s, optionally searching backward from from-index or nil if not found.

  • lower-case

    Converts string to all lower-case.

R

  • replace

    Replaces all instance of match with replacement in s. match/replacement can be: string / string pattern / (string or f...

  • replace-first

    Replaces the first instance of match with replacement in s. match/replacement can be: string / string pattern / (strin...

  • reverse

    Returns s with its characters reversed.

S

  • split

    Splits string on a regular expression. Optional argument limit is the maximum number of parts. Not lazy. Returns vector ...

  • split-lines

    Splits s on \n or \r\n. Trailing empty lines are not returned.

  • starts-with?

    True if s starts with substr.

T

  • trim

    Removes whitespace from both ends of string.

  • trim-newline

    Removes all trailing newline \n or return \r characters from string. Similar to Perl's chomp.

  • triml

    Removes whitespace from the left side of string.

  • trimr

    Removes whitespace from the right side of string.

U

  • upper-case

    Converts string to all upper-case.