10 lines
228 B
Python
10 lines
228 B
Python
import re
|
|
|
|
|
|
def to_camelcase(s):
|
|
s = re.sub(r"(_|-)+", " ", s).title().replace(" ", "").replace("*", "")
|
|
return "".join([s[0].lower(), s[1:]])
|
|
|
|
|
|
def to_snakecase(s):
|
|
return re.sub(r"(?<!^)(?=[A-Z])", "_", s).lower()
|