rwskit.strings

String utilities.

Functions

camel_to_snake_case(→ str)

Convert the string from CamelCase to snake_case.

Module Contents

rwskit.strings_.camel_to_snake_case(s: str) str[source]

Convert the string from CamelCase to snake_case.

This method uses a simple regular expression to convert a string in CamelCase to one in snake_case. Strings with 2 or fewer are simply lowercased and returned.

Parameters:

s (str) – The string to convert.

Returns:

The string in snake case.

Return type:

str