strings.string_switch_case

Functions

split_input(→ list)

to_camel_case(→ str)

to_complex_case(→ str)

Returns the string concatenated with the delimiter we provide.

to_kebab_case(→ str)

to_pascal_case(→ str)

to_simple_case(→ str)

to_snake_case(→ str)

Module Contents

strings.string_switch_case.split_input(str_: str) list
>>> split_input("one two 31235three4four")
[['one', 'two', '31235three4four']]
strings.string_switch_case.to_camel_case(text: str) str
>>> to_camel_case("one two 31235three4four")
'oneTwo31235three4four'
strings.string_switch_case.to_complex_case(text: str, upper: bool, separator: str) str

Returns the string concatenated with the delimiter we provide.

Parameters: @text: The string on which we want to perform operation @upper: Boolean value to determine whether we want capitalized result or not @separator: The delimiter with which we want to concatenate words

Examples: >>> to_complex_case(“one two 31235three4four”, True, “_”) ‘ONE_TWO_31235THREE4FOUR’ >>> to_complex_case(“one two 31235three4four”, False, “-“) ‘one-two-31235three4four’

strings.string_switch_case.to_kebab_case(text: str, upper: bool) str
>>> to_kebab_case("one two 31235three4four", True)
'ONE-TWO-31235THREE4FOUR'
>>> to_kebab_case("one two 31235three4four", False)
'one-two-31235three4four'
strings.string_switch_case.to_pascal_case(text: str) str
>>> to_pascal_case("one two 31235three4four")
'OneTwo31235three4four'
strings.string_switch_case.to_simple_case(str_: str) str
>>> to_simple_case("one two 31235three4four")
'OneTwo31235three4four'
>>> to_simple_case("This should be combined")
'ThisShouldBeCombined'
>>> to_simple_case("The first letters are capitalized, then string is merged")
'TheFirstLettersAreCapitalizedThenStringIsMerged'
>>> to_simple_case("special characters :, ', %, ^, $, are ignored")
'SpecialCharactersAreIgnored'
strings.string_switch_case.to_snake_case(text: str, upper: bool) str
>>> to_snake_case("one two 31235three4four", True)
'ONE_TWO_31235THREE4FOUR'
>>> to_snake_case("one two 31235three4four", False)
'one_two_31235three4four'