Convert Strings into any Case
A consistent, flexible and easy to use tool to parse and convert strings into cases like snake or camel among others.
- cases: added
to_sentence_case() (same as snake, but first letter is uppercase and default sep_out is space).
- numerals: added
numerals argument to all caseconverters including
to_any_case() to format the alignment of digits (
parsing_option nr 4 might be removed in later releases, as it is the same as
parsing_option = 1 and
numerals = "asis".
- transliterations: When named character elements are supplied as part of
transliterations, anyting that mateches the name is replaced by the corresponding value.
- attributes are now preserved (not only names as before)
- CRAN release
- Change default
"[^[:alnum:]]". This will make it easier for beginners and in general also faster to modify cases from names like
names(iris). Updated the regarding sections in the vignette and readme.
to_swap_case(), which is also available in
case = "swap" or
case = "flip"
- abbreviations work now also in conversions to lower- and upper camel case.
parsing_options 3 and 4 with 5 and 6.
- removed purrr dependency
- removed magrittr dependency
- added parsing option 6, which doesn't surround digits with separators.
- some breaking changes:
- reordering of the arguments of all
- changes since last CRAN submission include:
- to_xxx_case shortcuts are now exact wrappers around to_any_case
process is deprecated after changing implementation and setting a reasonable default.
abbreviations argument to
- case none is now a lot more general for formatting
abbreviation specific behaviour for mixed case
- new parsing_option 5, which suppresses conversion after ., @, etc
- renaming of:
- to_small / to_big_camel_case have been renamed to to_lower / to_upper_camel_case. The old names are and will still be supported in to_any_case
- introduced rule that parsing_option <= 0 suppresses parsing from now on
- lots of additional tests and smaller bugfixes
- several documentation updates including help, examples, readme and vignette
- all to_xxx_case functions are now exact wrappers of to_any_case
- to_small / to_big_camel_case have been renamed to to_lower / to_upper_camel_case
- minimal vignette update
- more consistency for case none
- bugfix for parsing option 5
- overhaul readme
parsingoption argument to
process argument: changed implementation in
to_any_case, set a reasonable default, implemented the behaviour also in to_xxx shortcut functions, deprecated
- make modifications to case none, which allows now more parsing options
- added special behaviour for abbreviations within "mixed_case"
- added abbreviations argument for better mixed case handling
improve consistency with stringr pkg regarding special input handling
- Changes since last update:
to_any_case() and shortcuts (
to_xxx_case() functions) preserve name attribute now
- R dependency lowered to 3.1
to_any_case() and the other converter function now preserve the names attribute. (Thanks to @strengejacke)
case == "none" works now with
- fixed bug so that
case = upper_lower no also works for
- added shortcutfunctions
Implemented two further parsing options:
- 3: parses the first UPPER letter group like parsing option 2 and the rest like option 1
- 4: parses the first UPPERlowercase letter group like parsingoption 1 and the rest like option 2
bug fix in devversion: protect works now for beginning and end of substrings and not anymore only for complete substrings.
Fix bug for
character(0) in combination with
replace special character is now a character vector. It's entries have to be elements of
stringi::stri_trans_list() or names of the transliteration dictionary list,
which comes with this package. This update enables users to transliterate strings from different encodings, in a flexible way. For example UTF8 to Ascii, ... .
- provided aliases
- small bug fix for upper_lower/lower_upper regarding the behaviour for the combination of preprocess and protect (similar to an earlier bug in the camel cases).
- small bug fix for behaviour of upper_lower/lower_upper. Now substrings with
without alphabetical characters are ignored.
- new implemented cases: "none", "mixed", "upper_lower", "lower_upper".
- empty_fill runs again in the end, before the pre and postprocess
- fixed bug:
to_any_case("r.aStudio", protect = "a", postprocess = "-", case = "big_camel") will now
correctly return "R-.AStudio" (so the protection will be triggered by the input and not by the output). In contrast
protect = A will yield in unprotected output (
- empty_fill runs now at the beginning of to any case function (after the first parsing)
and a second parsing is introduced in case anything is filled.
- fixed bug in camelcases, for letters after protected symbols (usually one wouldn't
protect in these cases anyway...)
check_design_rule() (not exported)
- resolved bugs in other design options (also deleted one which is not valid for
screaming snake case)
- included several parsingoptions for
1: "RRRStudio" -> "RRR_Studio" stays as default
2: "RRRStudio -> RRRS_tudio"
any other number will suppress the parsing (only spaces will be converted into "_")
- This is the (stable) development version now. You can find snakecase on cran here
- changed order of the customizing arguments of
- fixed bug for combination of protect and postprocess. Therefore clarified and rewrote the internal order of
- resolved all internal build warnings and notes
- fixed bug in replace_special_characters combined with screaming snake case.
- any local special characters are now supported.
- added 2 arguments to
to_any_case(): empty_fill, which allows to fill strings
matching to "" with the supplied string. unique_sep adds an integer suffix separated
with the supplied string, when not
- fixed a bug in to_snake_case_internal(). groups of digits are not separated in
- digits that are not direct next to each other, will be split via "_" in both camel case
versions. This is a meaningful exception. Otherwise information would be lost and
also the consistency rules in the readme wouldn't hold in this case.
- any_case() is now vectorised over pre-/postprocess, pre-/postfix for all case arguments
- introduces protect as (vectorised) argument to to_any_case(). it accepts regular expressions and cleans "_" or whatever the preprocessing did, between matches.
- some more tests, documentation and fixes.
- introduced case = "parsed" in to_any_case()
- introduced to_parsed_case()
- finished vignette (title: Caseconverters) and replaced the usage part in readme with it.
- changed behaviour in snake_case_internal to always treat whitespaces as underscores.
for whitespaces in output postprocess = " " is recommended.
- started testing
to_any_case and removed a bug.
- added vignette
- supports behaviour for german umlauts on all platforms
- introduced internal function
to_snake_case_internal() which does the preprocessing and simplifies all other functions (especially
to_any_case()) a little bit.
- added arguments prefix, postfix and replace_special_characters to
- completely renewed readme
- updated tests and highly modularized all tests. (just to_any_case lacks some tests now and in general more examples testcases have to be written)
to_any_case() (all functionality and documentation provided, but implementation has to be cleaned and also tests have to be written)
- fixed bug:
to_snake_case_dev(c("ssRRss")) returns now
ss_r_rss instead of
to_snake_case() now treats only spaces like underscores now (not dots anymore)
- functionality to treat different stuff like dots will be added via a new function:
to_any_case(), which will wrap the other three and will have pre- and postprocess arguments
- renamed the single input parameters consistent to
string (without deprecating
the old name before, since the package was in early dev-stage anyway).
- started a to develop and implement consistent logic (which still has to be better documented in the readme)
- introduced tests for more hard coded examples and the logic behind it (still more
hardcoded examples and a third part of the logic have to be tested)
- internal logic has been simplified and modularised a lot, which makes it easier
to maintain and introduce more highlevel features in the future
- added integrated tests via appveyor on windows
- added badges for cran status and codecoverage to readme
to_snake_case() which converts strings to snake_case.
- added functions
to_big_camel_case() which internally
build up on
to_snake_case() and convert to the appropriate target case.
- added basic hard coded tests
- added integrated tests on linux via travis.ci