mayo v0.1.0 Mayo.String

Summary

Functions

Checks the length of a string

Checks the maximum length of a string

Checks the minimum length of a string

Functions

length(value, len)

Checks the length of a string.

iex> Mayo.String.length("test", 4)
"test"

iex> Mayo.String.length("test", 5)
{:error, %Mayo.Error{type: "string.length"}}
max(value, len)

Checks the maximum length of a string.

iex> Mayo.String.max("test", 5)
"test"

iex> Mayo.String.max("bucket", 5)
{:error, %Mayo.Error{type: "string.max"}}
min(value, len)

Checks the minimum length of a string.

iex> Mayo.String.min("test", 3)
"test"

iex> Mayo.String.min("t", 3)
{:error, %Mayo.Error{type: "string.min"}}