Skip to content

toSnakeCase()

toSnakeCase(input): string

Defined in: src/utils/stringUtils.ts:73

Converts a string to snake_case.

Parameters

input

string

The string to convert.

Returns

string

The snake_case string.

Example

tsx
toSnakeCase('camelCaseString'); // 'camel_case_string'
toSnakeCase('anotherExample'); // 'another_example'

Released under the MIT License.