Mostly this vignette should be unnecessary. The majority of the uses of this package will be simply transform a string according to a simple standard, for example:
"one flew over the cuckoo's nest" %>% str_title_case "/home/hstruman secret files" %>% str_spine_case "The QUICK brown fox" %>% str_lower_case "first_name" %>% str_camel_case
Most of the lettercase functions are self-explanatory. Almost every function takes a character/string input (as the first argument) and performs the transformation on the string accordingly. This vignette is probably unnessary, but may be of value as getting better introduced to the package.
Lettercase contains functions for formatting:
It works with magrittr/pipeR operators; all transformations take a character/string as the first argument.
Transformations are:
The following cases affect capitalization only
str_lower[[_]case]
str_upper[[_]case]
str_sentence_case
(Only the first character and characters following punctions marks: . ! ? are capitalized)str_title_case
Word breaks, sentence breaks and whitespace ...
In most Cases, whitespace is defined .....
Lettercase also allows definition for how word breaks, line breaks, sentence breaks and white space are treated.
In snake_case, white space is defined by an underscore. In spinal-case, white space is a hyphen.
functions collapse_whitespace: adjacent whitespace are collapsed into one a single whitespace character.
collapse.whitespace
In general, the formatting transformation are destructive and irrevesible. While classes and attributes can be used to track input data, we felt this was an edge case. Most of the time, the original strings do not need to be preserved
Most functions are idempotent. Multiple application of the same function
F(F(x)) = F(x)
By design lettercase's transformation are (mostly) state functions independent of the order they are appied. For example,
G(F(x)) = F(G(x))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.