python-case-converter
python-case-converter copied to clipboard
Is the behavior of `macrocase` right?
macrocase("My URL")
returns MY_UR_L
(note the underscore between R
and L
). I would expect MY_URL
Regarding the word boundaries I would expect a result similar to cobolcase
, snakecase
, and kebabcase
.
cobolcase("My URL")
returns MY-URL
>>> from caseconverter import *
>>> cases = [str, macrocase, cobolcase, kebabcase, snakecase]
>>> for case in cases:
... t = f"{case.__name__: <15}"
... for s in ["My New URL", "My NewURL", "My URL", "My IP", "My MACRO"]:
... t += f"{case(s): <15}"
... print(t)
str My New URL My NewURL My URL My IP My MACRO
macrocase MY_NEW_UR_L MY_NEW_U_R_L MY_UR_L MY_IP MY_MA_C_R_O
cobolcase MY-NEW-URL MY-NEW-URL MY-URL MY-IP MY-MACRO
kebabcase my-new-url my-new-url my-url my-ip my-macro
snakecase my_new_url my_new_url my_url my_ip my_macro