to_snake_case

stringtools.to_snake_case(string)

Changes string to snake case.

Changes words to snake case:

>>> stringtools.to_snake_case('scale degrees 4 and 5')
'scale_degrees_4_and_5'

Changes snake case to snake case:

>>> stringtools.to_snake_case('scale_degrees_4_and_5')
'scale_degrees_4_and_5'

Changes dash case to snake case:

>>> stringtools.to_snake_case('scale-degrees-4-and-5')
'scale_degrees_4_and_5'

Changes snake case to snake case:

>>> stringtools.to_snake_case('ScaleDegrees4And5')
'scale_degrees_4_and_5'

Returns string.