We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1de33fd commit 6ce7f6fCopy full SHA for 6ce7f6f
1 file changed
yuno/utils/string.py
@@ -19,6 +19,6 @@ def toCamelCase(string: str):
19
return string
20
split = string.split("_") # split by underscore
21
final_split = []
22
- for s in split:
+ for s in split[(1 if string.startswith("_") else 0):]:
23
final_split.extend(s.split(" ")) # split by space
24
- return "".join(l.capitalize() if index > 0 else l for index, l in enumerate(final_split))
+ return ("_" if string.startswith("_") else "") + "".join(l.capitalize() if index > 0 else l for index, l in enumerate(final_split))
0 commit comments