这是PascalCase: SomeSymbol

这是骆驼

这是snake_case: some_symbol

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


当前回答

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

其他回答

我只想说它是连字符。

我的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();
}

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

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

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

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

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