功能函数的设计初衷是将目标字符串驼峰化的api:比如CSS样式特性与JavaScipt样式属性的切换
- background-color 与 style.backgroundColor
- font-weight 与 fontWeight
- font-family 与 fontFamily
~~~~~~~~~~~~~~
 
/*
*toCamelCase -- 将目标字符串进行驼峰化处理*
*@function*
*@param {String} source*
*@return {String} 格式化处理后的字符串*
*/
ZYC.string.toCamelCase = function(source){
    if(source.indexOf('-') <0 && source.indexOf('_') <0){
	    return source;
	}
	return source.replace(/[-_][^-_]/g,function(match){
	    return match.charAt(1).toUpperCase();
	});
}; 
简单阐述一下这段代码的优势:
- 优先判断是否indexOf('-')与indexOf('_'),算是一个性能的优化
- 转换的算法
- string.charAt(pos) 返回string中的pos位置处的字符。如果pos小于0或大于字符串的长度,它会返回空字符串
再次简单地讲述一下string.charAt(pos)
 
String.method('charAt',function(){
    return this.slice(0,1);  //精髓
});
console.log('Ability'.charAt(0));   //A









