coalib.bearlib.naming_conventions package — coala 0.9.0.dev99999999999999 documentation

# coalib.bearlib.naming_conventions package

## Module contents

`coalib.bearlib.naming_conventions.` `to_camelcase`(string)

  Converts the given string to camel-case.

      >>> to_camelcase('Hello_world')
      'helloWorld'
      >>> to_camelcase('__Init__file__')
      '__initFile__'
      >>> to_camelcase('')
      ''
      >>> to_camelcase('alreadyCamelCase')
      'alreadyCamelCase'
      >>> to_camelcase('   string')
      '___string'

  Parameters: | string – The string to convert.
  Returns: | The camel-cased string.

`coalib.bearlib.naming_conventions.` `to_pascalcase`(string)

  Converts the given to string pascal-case.

      >>> to_pascalcase('hello_world')
      'HelloWorld'
      >>> to_pascalcase('__init__file__')
      '__InitFile__'
      >>> to_pascalcase('')
      ''
      >>> to_pascalcase('AlreadyPascalCase')
      'AlreadyPascalCase'
      >>> to_pascalcase('   string')
      '___String'

  Parameters: | string – The string to convert.
  Returns: | The pascal-cased string.

`coalib.bearlib.naming_conventions.` `to_snakecase`(string)

  Converts the given string to snake-case.

      >>> to_snakecase('HelloWorld')
      'hello_world'
      >>> to_snakecase('__Init__File__')
      '__init_file__'
      >>> to_snakecase('')
      ''
      >>> to_snakecase('already_snake_case')
      'already_snake_case'
      >>> to_snakecase('   string  ')
      '___string__'
      >>> to_snakecase('ABCde.F.G..H..IH')
      'a_b_cde.f.g..h..i_h'

  Parameters: | string – The string to convert.
  Returns: | The snake-cased string.

`coalib.bearlib.naming_conventions.` `to_spacecase`(string)

  Converts the given string to space-case.

      >>> to_spacecase('helloWorld')
      'Hello World'
      >>> to_spacecase('__Init__File__')
      'Init File'
      >>> to_spacecase('')
      ''
      >>> to_spacecase('Already Space Case')
      'Already Space Case'
      >>> to_spacecase('  string  ')
      'String'

  Parameters: | string – The string to convert.
  Returns: | The space-cased string.