📜  js camalcase - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:21.285000             🧑  作者: Mango

代码示例1
const camelize = (str) => {
  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
    return index === 0 ? word.toLowerCase() : word.toUpperCase();
  }).replace(/\s+/g, '');
}