MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / to_camel_case

Function to_camel_case

strings/string_switch_case.py:89–98  ·  view source on GitHub ↗

>>> to_camel_case("one two 31235three4four") 'oneTwo31235three4four'

(text: str)

Source from the content-addressed store, hash-verified

87
88
89def to_camel_case(text: str) -> str:
90 """
91 >>> to_camel_case("one two 31235three4four")
92 'oneTwo31235three4four'
93 """
94 try:
95 res_str = to_simple_case(text)
96 return res_str[0].lower() + res_str[1:]
97 except IndexError:
98 return "not valid string"
99
100
101def to_snake_case(text: str, upper: bool) -> str:

Callers

nothing calls this directly

Calls 1

to_simple_caseFunction · 0.85

Tested by

no test coverage detected