executor v0.0.3 Executor.Util.String

This module contains convienent helper functions related to strings

Summary

Functions

Returns the string found between two instances of the delimiter

Return the string with preceading newline removed if one existed

Return the string with trailing newline removed if one existed

Replaces newlines with semi-colons

Returns the string with the first letter uppercase and the rest of the letters lowercase

Returns string with newlines removes from beginning of end

Functions

match_between(string, delimiter)

Returns the string found between two instances of the delimiter

iex> match_between(“applejuiceapple”, “apple”) “juice”

iex> match_between(“applejuiceapple”, “orange”) nil

remove_preceading_newline(result)

Return the string with preceading newline removed if one existed

iex> remove_preceading_newline(“\napple”) “apple”

iex> remove_preceading_newline(“apple”) “apple”

remove_trailing_newline(result)

Return the string with trailing newline removed if one existed

iex> remove_trailing_newline(“apple\n”) “apple”

iex> remove_trailing_newline(“apple”) “apple”

semicolonize(string)

Replaces newlines with semi-colons

iex> semicolonize(“java\nscript”) “java;script”

titleize(string)

Returns the string with the first letter uppercase and the rest of the letters lowercase

iex> titleize(“apple”) “Apple”

iex> titleize(“APPLE”) “Apple”

trim_newlines(string)

Returns string with newlines removes from beginning of end

iex> trim_newlines(“\napple\n”) “apple”

iex> trim_newlines(“apple\n”) “apple”

iex> trim_newlines(“\napple”) “apple”

iex> trim_newlines(“apple”) “apple”