camel_case

negmas.helpers.camel_case(s: str, capitalize_first: bool = False, lower_first: bool = False)str[source]

Converts a string from snake_case to CamelCase

Example

>>> print(camel_case('this_is_a_test'))
thisIsATest
>>> print(camel_case('this_is_a_test', capitalize_first=True))
ThisIsATest
>>> print(camel_case('This_is_a_test', lower_first=True))
thisIsATest
>>> print(camel_case('This_is_a_test'))
ThisIsATest
Parameters
  • s – input string

  • capitalize_first – if true, the first character will be capitalized

  • lower_first – If true, the first character will be lowered

Returns

converted string

Return type

str