Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple logic implementation solution in Speedy category for Conversion into CamelCase by Merzix
def to_camel_case(name, sep='_'):
ans, flag = [], True
for letter in name.lower():
if letter == sep:
flag = True
continue
ans.append(letter.upper() if flag else letter)
flag = False
return ''.join(ans)
if __name__ == '__main__':
assert to_camel_case("my_function_name") == "MyFunctionName"
assert to_camel_case("i_phone") == "IPhone"
assert to_camel_case("this_function_is_empty") == "ThisFunctionIsEmpty"
assert to_camel_case("name") == "Name"
Sept. 28, 2018