【发布时间】:2023-02-20 22:32:56
【问题描述】:
使用下面的正则表达式将下面的 javascript 函数转换为 C#
`
const camelize = (str) => {
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => {
return index === 0 ? word.toLowerCase() : word.toUpperCase();
}).replace(/\s+/g, '');
}
console.log(camelize("EquipmentClass name"));
`
【问题讨论】:
-
你有没有尝试过?
标签: c# regex camelcasing