Skip to content

snakeCase() function

str을 snake case로 변환합니다. 공백·구두점·숫자·대소문자 경계·두문자어를 기준으로 단어를 분리합니다.

Signature:

typescript
function snakeCase(str: string): string;

Example

ts
snakeCase("foo bar"); // "foo_bar"
snakeCase("fooBar"); // "foo_bar"
snakeCase("foo-bar"); // "foo_bar"
snakeCase("XMLHttpRequest"); // "xml_http_request"

Open Source Code

Released under the Apache-2.0 License.