# Module cloudi_string

- Description
- Function Index
- Function Details

### String manipulation functions

.

Copyright © 2009-2017 Michael Truog

Version: 1.6.1 Mar 28 2017 19:21:38 ------------------------------------------------------------------------

Authors: Michael Truog (`mjtruog [at] gmail (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.
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)..
list_to_term/1 | #### Convert a string to an Erlang term. .
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. .
term_to_list/1 | #### Convert an Erlang term to a string. .

## Function Details

### afterl/2

`afterl(Char::pos_integer(), Rest::string()) -> string()`

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

### afterl/3

`afterl(Char::pos_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::pos_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::pos_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::pos_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::pos_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::pos_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::pos_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::binary(), Correct::binary()) -> 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.

### 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)..

### list_to_term/1

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

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

### splitl/2

`splitl(Char::pos_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::pos_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::pos_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::pos_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()`

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

### term_to_list/1

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

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

Generated by EDoc, Mar 28 2017, 19:21:38.