这是PascalCase: SomeSymbol

这是骆驼

这是snake_case: some_symbol

所以我的问题是,这是否有一个被广泛接受的名称:某种符号?它通常用于url。


当前回答

我的ECMAScript建议String.prototype.toKebabCase。

String.prototype.toKebabCase = function () {
  return this.valueOf().replace(/-/g, ' ').split('')
    .reduce((str, char) => char.toUpperCase() === char ?
      `${str} ${char}` :
      `${str}${char}`, ''
    ).replace(/ * /g, ' ').trim().replace(/ /g, '-').toLowerCase();
}

其他回答

在这里添加正确的链接串案例

这是所有小写字母与-分隔词。

这是最著名的案例,它有很多名字

烤肉箱:官方软件最常用的名称 caterpillar-case dash-case 连字符大小写或连字符大小写 lisp-case spinal-case css-case slug-case friendly-url-case

它被称为烤肉箱。请参阅lodash文档。

我一直叫它,也听人叫它“仪表盘”。

这种外壳也可以被称为“slug”,将一个短语变成它的过程也可以被称为“slugify”。

https://hexdocs.pm/slugify/Slug.html