Skip to content

to snake case

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Convert string to snake case.

const toSnakeCase = require('@extra-string/to-snake-case');
// toSnakeCase(<string>, [joiner=_], [separator=/\W+/g])

toSnakeCase('Malwa Plateau');
// 'malwa_plateau'
toSnakeCase('::chota::nagpur::', '-');
// 'chota-nagpur'
toSnakeCase('deccan___plateau', '.', '_');
// 'deccan.plateau'

extra-string

Clone this wiki locally