Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

js中如何根据字符串的指针进行字符串修改,跪求,急

$
0
0

就比如:

var a = 'UserAuth';
a[0] = a[0].toLowerCase();
console.log(a[0].toLowerCase());
console.log(a[0]);
console.log(a);

输出结果:

u
U
UserAuth

我仅仅要将首字母小写,有什么办法能够直接修改a[0]的值,之前实现过后来给忘了 如果说是js字符串截取的方法那就不用说了


Viewing all articles
Browse latest Browse all 14821

Trending Articles