Search Docs
toSnakeCase
Converts the str to snake_case, where words are separated by underscores and all letters are lowercase.
str
import { toSnakeCase } from 'funtool/string' toSnakeCase('helloWorld'); // ✅ 'hello_world' toSnakeCase('HelloWorld'); // ✅ 'hello_world' toSnakeCase('hello-world'); // ✅ 'hello_world' toSnakeCase('APIVersion'); // ✅ 'api_version' toSnakeCase('MyXMLParser'); // ✅ 'my_xml_parser
function toSnakeCase(str: string): string
string