📜  将字符串的首字母大写 javascript 代码示例

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

代码示例6
let val = '  this is test ';
val = val.trim();
val = val.charAt(0).toUpperCase() + val.slice(1);
console.log("Value => ", val);