字符串去除空格且首字母转为大写

const transformString = (s) => {
const res = s.charAt(0).toLowerCase().concat(s.slice(1)).replace(/\s+/g, '');
return res;
};
posted @ 2020-08-13 15:42  燕子fly  阅读(249)  评论(0编辑  收藏  举报