Elixir Prelude v0.2.0 Prelude.String

Functions operating on strings.

Summary

Functions

Returns the first code point in the string, or nil if str is empty

Checks if a string is the string representation of an integer

Chops off the first codepoint, and returns the rest of the string

Safely convert strings to integers

Functions

head(str)

Returns the first code point in the string, or nil if str is empty

is_integer?(str)

Checks if a string is the string representation of an integer

tail(str)

Chops off the first codepoint, and returns the rest of the string.

Returns an empty string if String.length(str) == 1, and nil if string is empty.

to_int(y)

Safely convert strings to integers

Leaves integers alone, and defaults to 0 on error