Cldr.String (cldr_utils v2.16.0) View Source
Functions that operate on a
String.t that are not provided
in the standard lib.
Link to this section Summary
Link to this section Functions
Hash a string using a polynomial rolling hash function.
See https://cp-algorithms.com/string/string-hashing.html for a description of the algoithim.
Replaces "-" with "_" in a string.
iex> Cldr.String.to_underscore("this-one") "this_one"
This is the code of Macro.underscore with modifications:
The change is to cater for strings in the format:
which in Macro.underscore gets formatted as:
this__that (note the double underscore)
when we actually want: