javascript字符串 转 驼峰字符

字符串  转  驼峰字符

 1 <script type="text/javascript">
 2 
 3             var str = 'peng-hui-datou';
 4             function  a(str){
 5                 var Array = str.split('-');
 6                 for(var i=0;i<Array.length;i++){
 7                     Array[i] = Array[i].charAt(0).toUpperCase() + Array[i].substring(1);
 8                 }
 9                  var newArray = Array.join('');
10                 
11             }
12 <script >
原文地址:https://www.cnblogs.com/webph/p/5538676.html