Converts string to snake case.
string
3.0.0
camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst
snakeCase('Foo Bar')// => 'foo_bar'snakeCase('fooBar')// => 'foo_bar'snakeCase('--FOO-BAR--')// => 'foo_bar'snakeCase('foo2bar')// => 'foo_2_bar' Copy
snakeCase('Foo Bar')// => 'foo_bar'snakeCase('fooBar')// => 'foo_bar'snakeCase('--FOO-BAR--')// => 'foo_bar'snakeCase('foo2bar')// => 'foo_2_bar'
Optional
The string to convert.
Returns the snake cased string.
Converts
string
to snake case.Since
3.0.0
See
camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst
Example