文本

大小写 SnakeCase

免费且即时的在线工具,可将普通文本、字符串或变量转换为 SnakeCase。

输入文本
snake-case 结果
100% 安全
快速转换
高精准度

免费在线 SnakeCase 转换器

我们的字符串格式化工具可瞬间将您的普通文本、句子或代码变量转换为 SnakeCase。只需粘贴您的内容,工具即可自动处理空格和大小写。

如何转换

1. 粘贴 大小写 文本

将您的 大小写 内容粘贴或输入到输入框中。

2. 转换过程

我们的工具会自动以最佳设置将您的文本转换为 SnakeCase 格式。

3. 复制 SnakeCase

转换完成。您现在可以直接将结果复制到剪贴板。

常见问题解答

转换规格

输入大小写
输出SnakeCase
安全性HTTPS / 自动删除
价格
免费

使用代码

snakeCase

Converts a given string to snake_case format by handling acronyms, camelCase, letter-to-number and number-to-letter boundaries, and replacing common delimiters (spaces, hyphens, dots) with underscores. The result is trimmed of leading/trailing underscores and converted to lowercase.

参数

名称类型描述
textstringThe string to convert.

返回值

stringThe snake cased string.
npm i @razomy/string-case
import {snakeCase} from '@razomy/string-case';

snakeCase('fooBar');
// => foo_bar

snakeCase('Foo Bar');
// => foo_bar

snakeCase('FOO-BAR');
// => foo_bar