camel_case

negmas.helpers.camel_case(s, capitalize_first=False, lower_first=False)[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 (str) – input string

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

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

Returns:

converted string

Return type:

str