Fox.StringExt
SourceSummary
camelize(string) | Takes a string and makes it camel-cased. Note that “/“ become periods “.” |
consume!(meal, bite) | |
consume(meal, bite) | Takes a string consume from the left a portion of the string and returns the remaining string |
float?(string) | |
integer?(string) | |
next_grapheme(string) | |
next_grapheme(string, arg2) | |
number?(string) | |
pluralize(noun) | Takes a singular word and returns the plural form |
random() | Generates a random string of length n. Defaults to n = 10 |
random(n) | |
reverse_consume!(meal, bite) | |
reverse_consume(meal, bite) | |
singularize(nouns) | Takes a word and returns its singular form |
to_url(string) | Takes a string and builds it into an url-friendly string, good for permalinks and generally being passed around in the browser |
transformations() | |
transformify(arg1) | |
underscore(string) | Takes a string and makes it underscored. This is the semi-inverse of camelize. Note that because this is Elixir and not ruby, periods become “/“, not “::” |
Functions
Takes a string and makes it camel-cased. Note that “/“ become periods “.”
Examples
“under_scored” |> camelize # UnderScored
# acronyms are not restored by camelize (lol obviously) “acronym_hiv” |> camelize # AcronymHiv
# spaces are ignored “sakidasu kasa no mure ni” |> camelize # Sakidasu kasa no mure ni
“my_app/module/sub_module” |> camelize # MyApp.Module.SubModule
Takes a string consume from the left a portion of the string and returns the remaining string
Takes a singular word and returns the plural form
Generates a random string of length n. Defaults to n = 10
Takes a word and returns its singular form
Takes a string and builds it into an url-friendly string, good for permalinks and generally being passed around in the browser
Takes a string and makes it underscored. This is the semi-inverse of camelize. Note that because this is Elixir and not ruby, periods become “/“, not “::”
Examples
“CamelCase” |> underscore # camel_case
“AcronymHIV” |> underscore # acronym_hiv
“dasher-ized” |> underscore # dasher_ized
# Spaces are ignored (following rails convention) “regular words” |> underscore # regular words
“MyApp.Module.SubModule” |> underscore # my_app/module/sub_module