Skip to main content

Strings

  • char

    Coerce to char

  • format

    Formats a string using goog.string.format.

  • keyword

    Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will be added automaticall...

  • name

    Returns the name String of a string, symbol or keyword.

  • parse-boolean

    Parse strings "true" or "false" and return a boolean, or nil if invalid. Note that this explicitly excludes strings with...

  • parse-double

    Parse string with floating point components and return a floating point value, or nil if parse fails. Grammar: https://d...

  • parse-long

    Parse string of decimal digits with optional leading -/+ and return an integer value, or nil if parse fails

  • parse-uuid

    Parse a string representing a UUID and return a UUID instance, or nil if parse fails. Grammar: https://docs.oracle.com/j...

  • str

    With no args, returns the empty string. With one arg x, returns x.toString(). (str nil) returns the empty string. With ...

  • symbol

    Returns a Symbol with the given namespace and name. Arity-1 works on strings, keywords, and vars.

  • blank?

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

  • capitalize

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

  • 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...

  • 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.

  • join

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

  • 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.

  • 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.

  • 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.

  • subs

    Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive.

  • 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.

  • upper-case

    Converts string to all upper-case.

  • string?

    Returns true if x is a JavaScript string.

  • re-find

    Returns the first regex match, if any, of s to re, using re.exec(s). Returns a vector, containing first the matching sub...

  • re-matches

    Returns the result of (re-find re s) if re fully matches s.

  • re-pattern

    Returns an instance of RegExp which has compiled the provided string.

  • re-seq

    Returns a lazy sequence of successive matches of re in s.