Ad
Code
Diff
  • to_camel_case = lambda t: t[0] + t.title().replace('_', '').replace('-', '')[1:] if t else ''
    • def to_camel_case(text):
    • k = text.split("-")
    • p = case_loop(k)
    • j = p.split("_")
    • m = case_loop(j)
    • return m
    • def case_loop(k):
    • p = []
    • for i,item in enumerate(k):
    • if i == 0:
    • p.append(item)
    • continue
    • # print(i,item)
    • a = item[0].upper()
    • b = item[1:]
    • c = f"{a}{b}"
    • p.append(c)
    • d = "".join(p)
    • return d
    • to_camel_case = lambda t: t[0] + t.title().replace('_', '').replace('-', '')[1:] if t else ''