Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Convert strings between different string cases
ResourceFunction["StringCaseConvert"][case,str] converts string str to use the case convension. | |
ResourceFunction["StringCaseConvert"][{sep, opts}, str] convert str to a custom case delimited by sep and with rules given by opts. | |
ResourceFunction["StringCaseConvert"][case] operator form of ResourceFunction["StringCaseConvert"]. |
| "CamelCase" | theQuickBrownFox |
| "CobolCase" | THE-QUICK-BROWN-FOX |
| "ConstantCase" | THE_QUICK_BROWN_FOX |
| "KebabCase" | the-quick-brown-fox |
| "LowerCase" | the quick brown fox |
| "LowerCaseFlat" | thequickbrownfox |
| "AdaCase" | The_Quick_Brown_Fox |
| "PascalCase" | TheQuickBrownFox |
| "SnakeCase" | the_quick_brown_fox |
| "TitleCase" | The Quick Brown Fox |
| "TrainCase" | The-Quick-Brown-Fox |
| "UpperCase" | THE QUCIK BROWN FOX |
| "UpperCaseFlat" | THEQUICKBROWNFOX |
| "Capitalize" | Capitalize the first letter of each word |
| "ToLowerCase" | Convert all characters to lower case |
| "ToUpperCase" | Convert all characters to upper case |
Convert any string case to kebab case:
| In[1]:= |
| Out[1]= |
The input can use a variety of string cases:
| In[2]:= | ![]() |
| Out[2]= |
The input string can contain any string case. Non-separator punctuation characters are ignored:
| In[3]:= | ![]() |
| Out[3]= |
Create an operator form of StringCaseConvert:
| In[4]:= |
| Out[5]= |
A custom string case can be defined by using a list in place of case:
| In[6]:= |
| Out[6]= |
StringCaseConvert changes the separator character convention:
| In[7]:= |
| Out[7]= |
ResourceFunction["ToCamelCase"] only applies to whitespace characters:
| In[8]:= |
| Out[8]= |
Capitalize ignores any punctuation:
| In[9]:= |
| Out[9]= |
Wolfram Language 12.1 (March 2020) or above
This work is licensed under a Creative Commons Attribution 4.0 International License