def to_camelcase(string):
 string = re.sub('(\\s)', (lambda match: '_'), string)
 string = re.sub('^(_*)(.)', (lambda match: (match.group(1) + match.group(2).lower())), string)
 return re.sub('(?<=[^_])_+([^_])', (lambda match: match.group(1).upper()), string)

def to_camelcase ( string ) : string = re . sub ( '(\\s)' , ( lambda match : '_' ) , string ) string = re . sub ( '^(_*)(.)' , ( lambda match : ( match . group ( 1 ) + match . group ( 2 ) . lower ( ) ) ) , string ) return re . sub ( '(?<=[^_])_+([^_])' , ( lambda match : match . group ( 1 ) . upper ( ) ) , string )
converts the given string to camel-case .