Below is my code and I was wondering if there was a way to keep caps the way they are?
Such as "num_to_SMS" would still become "numToSMS"?
def to_camel(ident):
return ''.join(x.capitalize() or '_' for x in ident.split('_'))
print(to_camel('foo'))
print(to_camel('raw_input'))
print(to_camel('num2words'))
print(to_camel('num_to_SMS'))
So far the last example outputs numToSms
not numToSMS
as desired.