Exrethinkdb.Query.StringManipulation

ReQL methods for string manipulation.

All examples assume that use Exrethinkdb has been called.

Summary

downcase(string)

Convert a string to all down case

match(string, regex)

Checks a string for matches

split(string)

Split a string on whitespace

split(string, separator)

Split a string on separator

split(string, separator, max_results)

Split a string with a given separator into max_result segments

upcase(string)

Convert a string to all upper case

Functions

downcase(string)

Specs:

Convert a string to all down case.

iex> "Hi" |> downcase |> run conn
%Exrethinkdb.Record{data: "hi"}
match(string, regex)

Specs:

Checks a string for matches.

Example:

iex> "hello world" |> match("hello") |> run conn
iex> "hello world" |> match(~r(hello)) |> run conn
split(string)

Specs:

Split a string on whitespace.

iex> "abracadabra" |> split |> run conn
%Exrethinkdb.Record{data: ["abracadabra"]}
split(string, separator)

Specs:

Split a string on separator.

iex> "abra-cadabra" |> split("-") |> run conn
%Exrethinkdb.Record{data: ["abra", "cadabra"]}
split(string, separator, max_results)

Specs:

Split a string with a given separator into max_result segments.

iex> "a-bra-ca-da-bra" |> split("-", 2) |> run conn
%Exrethinkdb.Record{data: ["a", "bra", "ca-da-bra"]}
upcase(string)

Specs:

Convert a string to all upper case.

iex> "hi" |> upcase |> run conn
%Exrethinkdb.Record{data: "HI"}