Elixir Prelude v0.2.1 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
Returns the first code point in the string, or nil
if str is empty
Example:
iex> Prelude.String.head("4545")
"4"
iex> Prelude.String.head("")
nil
Checks if a string is the string representation of an integer
Example:
iex> Prelude.String.is_integer?("34545")
true
iex> Prelude.String.is_integer?("a34545")
false
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.
Example:
iex> Prelude.String.tail("4545")
"545"
iex> Prelude.String.tail("")
nil