中文翻译成英文单词
浏览器F12 console控制台执行
function tf(str){
str = str.toLowerCase();
var re = / (\w)/g;
str = str.replace(re,function ($0,$1){
return $1.toUpperCase();
});
var re1 = /_(\w)/g;
str = str.replace(re1,function ($0,$1){
return $1.toUpperCase();
});
var re2 = /-(\w)/g;
str = str.replace(re2,function ($0,$1){
return $1.toUpperCase();
});
return str
}
tf('Data volume_ of-poor population');
//结果
dataVolumeOfPoorPopulation