# Module cloudi_string

- Description
- Function Index
- Function Details

### String manipulation functions

.

Copyright © 2009-2020 Michael Truog

Version: 2.0.1 Dec 3 2021 17:15:32 ------------------------------------------------------------------------

Authors: Michael Truog (`mjtruog at protonmail dot com`).

## Description

### String manipulation functions

## Function Index

afterl/2 | #### Return the string that occurs after a character, otherwise return an empty string, when traversing left to right. .
afterl/3 | #### Return the string that occurs after a character, otherwise return based on the failure atom, when traversing left to right. .
afterr/2 | #### Return the string that occurs after a character, otherwise return an empty string, when traversing right to left. .
afterr/3 | #### Return the string that occurs after a character, otherwise return based on the failure atom, when traversing right to left. .
beforel/2 | #### Return the string that occurs before a character, otherwise return an empty string, when traversing left to right. .
beforel/3 | #### Return the string that occurs before a character, otherwise return based on the failure atom, when traversing left to right. .
beforer/2 | #### Return the string that occurs before a character, otherwise return an empty string, when traversing right to left. .
beforer/3 | #### Return the string that occurs before a character, otherwise return based on the failure atom, when traversing right to left. .
binary_to_term/1 | #### Convert a binary string to an Erlang term. .
compare_constant/2 | #### Time insensitive compare to avoid a timing leak. Use for password or other authentication comparisons.
compare_constant_binary/2 | #### Time insensitive compare to avoid a timing leak with strings as binaries. Use for password or other authentication comparisons.
compare_constant_list/2 | #### Time insensitive compare to avoid a timing leak with strings as lists. Use for password or other authentication comparisons.
findl/2 | #### Find the beginning of a substring in a string from the left. .
findr/2 | #### Find the beginning of a substring in a string from the right. .
format/2 | #### Format a string based on the arguments. .
format_to_binary/2 | #### Format a string based on the arguments, stored as a binary. Output is a utf8 encoded binary.
format_to_list/2 | #### Format a string based on the arguments, stored as a list. Output may include unicode characters with a numerical value greater than 255 (preventing the output from being used directly with erlang:iolist_to_binary/1)..
join/2 | #### Join a list of strings with a string. .
list_to_term/1 | #### Convert a string to an Erlang term. .
lowercase/1 | #### Return the string in lowercase. .
split/2 | #### Split the string at all occurrences of the search pattern. .
splitl/2 | #### Return the two strings split at the first occurrence of the character, otherwise return an empty string, when traversing left to right. .
splitl/3 | #### Return the two strings split at the first occurrence of the character, otherwise return based on the failure atom, when traversing left to right. .
splitr/2 | #### Return the two strings split at the first occurrence of the character, otherwise return an empty string, when traversing right to left. .
splitr/3 | #### Return the two strings split at the first occurrence of the character, otherwise return based on the failure atom, when traversing right to left. .
term_to_binary/1 | #### Convert an Erlang term to a binary string. Output is a utf8 encoded binary.
term_to_binary_compact/1 | #### Convert an Erlang term to a compact binary string. Output is a utf8 encoded binary.
term_to_list/1 | #### Convert an Erlang term to a string. .
term_to_list_compact/1 | #### Convert an Erlang term to a compact string. .
titlecase/1 | #### Return the string in titlecase. .
trim/1 | #### Trim the edges of the string. .
trim/2 | #### Trim the edges of the string. .
triml/1 | #### Trim the edges of the string from the left. .
triml/2 | #### Trim the edges of the string from the left. .
trimr/1 | #### Trim the edges of the string from the right. .
trimr/2 | #### Trim the edges of the string from the right. .
uppercase/1 | #### Return the string in uppercase. .

## Function Details

### afterl/2

`afterl(Char::non_neg_integer(), Input::string()) -> string()`

#### Return the string that occurs after a character, otherwise return an empty string, when traversing left to right.

### afterl/3

`afterl(Char::non_neg_integer(), Input::string(), X3::empty | input) -> string()`

#### Return the string that occurs after a character, otherwise return based on the failure atom, when traversing left to right.

### afterr/2

`afterr(Char::non_neg_integer(), Input::string()) -> string()`

#### Return the string that occurs after a character, otherwise return an empty string, when traversing right to left.

### afterr/3

`afterr(Char::non_neg_integer(), Input::string(), X3::empty | input) -> string()`

#### Return the string that occurs after a character, otherwise return based on the failure atom, when traversing right to left.

### beforel/2

`beforel(Char::non_neg_integer(), Input::string()) -> string()`

#### Return the string that occurs before a character, otherwise return an empty string, when traversing left to right.

### beforel/3

`beforel(Char::non_neg_integer(), Input::string(), X3::empty | input) -> string()`

#### Return the string that occurs before a character, otherwise return based on the failure atom, when traversing left to right.

### beforer/2

`beforer(Char::non_neg_integer(), Input::string()) -> string()`

#### Return the string that occurs before a character, otherwise return an empty string, when traversing right to left.

### beforer/3

`beforer(Char::non_neg_integer(), Input::string(), X3::empty | input) -> string()`

#### Return the string that occurs before a character, otherwise return based on the failure atom, when traversing right to left.

### binary_to_term/1

`binary_to_term(B::binary()) -> any()`

#### Convert a binary string to an Erlang term.

### compare_constant/2

`compare_constant(Test::string(), Correct::nonempty_string()) -> boolean()`

#### Time insensitive compare to avoid a timing leak.

Use for password or other authentication comparisons. Execution time is based on the length of Test.

### compare_constant_binary/2

`compare_constant_binary(Test::<<_:_*8>>, Correct::<<_:8, _:_*8>>) -> boolean()`

#### Time insensitive compare to avoid a timing leak with strings as binaries.

Use for password or other authentication comparisons. Execution time is based on the length of Test.

### compare_constant_list/2

`compare_constant_list(Test::string(), Correct::nonempty_string()) -> boolean()`

#### Time insensitive compare to avoid a timing leak with strings as lists.

Use for password or other authentication comparisons. Execution time is based on the length of Test.

### findl/2

`findl(SearchPattern::string() | binary(), String::string() | binary()) -> string() | binary() | false`

#### Find the beginning of a substring in a string from the left.

### findr/2

`findr(SearchPattern::string() | binary(), String::string() | binary()) -> string() | binary() | false`

#### Find the beginning of a substring in a string from the right.

### format/2

`format(L::string(), A::list()) -> string()`

#### Format a string based on the arguments.

### format_to_binary/2

`format_to_binary(L::string(), A::list()) -> binary()`

#### Format a string based on the arguments, stored as a binary.

Output is a utf8 encoded binary.

### format_to_list/2

`format_to_list(L::string(), A::list()) -> string()`

#### Format a string based on the arguments, stored as a list.

Output may include unicode characters with a numerical value greater than 255 (preventing the output from being used directly with erlang:iolist_to_binary/1)..

### join/2

`join(Delimiters::string() | binary(), L::[string() | binary()]) -> string() | binary()`

#### Join a list of strings with a string.

### list_to_term/1

`list_to_term(L::string()) -> any()`

#### Convert a string to an Erlang term.

### lowercase/1

`lowercase(String::string() | binary()) -> string() | binary()`

#### Return the string in lowercase.

### split/2

`split(SearchPattern::string() | binary() | [string() | binary()], String::string() | binary()) -> [string() | binary()]`

#### Split the string at all occurrences of the search pattern.

### splitl/2

`splitl(Char::non_neg_integer(), Input::string()) -> {string(), string()}`

#### Return the two strings split at the first occurrence of the character, otherwise return an empty string, when traversing left to right.

### splitl/3

`splitl(Char::non_neg_integer(), Input::string(), X3::empty | input) -> {string(), string()}`

#### Return the two strings split at the first occurrence of the character, otherwise return based on the failure atom, when traversing left to right.

### splitr/2

`splitr(Char::non_neg_integer(), Input::string()) -> {string(), string()}`

#### Return the two strings split at the first occurrence of the character, otherwise return an empty string, when traversing right to left.

### splitr/3

`splitr(Char::non_neg_integer(), Input::string(), X3::empty | input) -> {string(), string()}`

#### Return the two strings split at the first occurrence of the character, otherwise return based on the failure atom, when traversing right to left.

### term_to_binary/1

`term_to_binary(T::any()) -> binary()`

#### Convert an Erlang term to a binary string.

Output is a utf8 encoded binary.

### term_to_binary_compact/1

`term_to_binary_compact(T::any()) -> binary()`

#### Convert an Erlang term to a compact binary string.

Output is a utf8 encoded binary.

### term_to_list/1

`term_to_list(T::any()) -> string()`

#### Convert an Erlang term to a string.

### term_to_list_compact/1

`term_to_list_compact(T::any()) -> string()`

#### Convert an Erlang term to a compact string.

### titlecase/1

`titlecase(String::string() | binary()) -> string() | binary()`

#### Return the string in titlecase.

### trim/1

`trim(String::string() | binary()) -> string() | binary()`

#### Trim the edges of the string.

### trim/2

`trim(Characters::string() | [string()], String::string() | binary()) -> string() | binary()`

#### Trim the edges of the string.

### triml/1

`triml(String::string() | binary()) -> string() | binary()`

#### Trim the edges of the string from the left.

### triml/2

`triml(Characters::string() | [string()], String::string() | binary()) -> string() | binary()`

#### Trim the edges of the string from the left.

### trimr/1

`trimr(String::string() | binary()) -> string() | binary()`

#### Trim the edges of the string from the right.

### trimr/2

`trimr(Characters::string() | [string()], String::string() | binary()) -> string() | binary()`

#### Trim the edges of the string from the right.

### uppercase/1

`uppercase(String::string() | binary()) -> string() | binary()`

#### Return the string in uppercase.

Generated by EDoc