首页 > 其他 > 详细

很好的代码 没用了 真可惜

时间:2015-05-18 18:25:12      阅读:230      评论:0      收藏:0      [点我收藏+]

貌似这两个函数是相对应而存在的,indexof是判断某个字符在字符串里是否存在,charat就是某个字符串中某个数字对应的字符是什么。
============================
if(input_t.indexOf(option_t) < 0){
                input_t += option_t+‘;‘;
                $(this).parents(‘.to-list‘).siblings(‘input‘).val(input_t);    

}else{                
                input_t = input_t.replace(option_t+‘;‘,‘‘);
                $(this).parents(‘.to-list‘).siblings(‘input‘).val(input_t);    


----------------------------

indexOf 相当于 substr strpos 检测字符串中是否有某个字符
---------------
charAt(0123456678) 的
求出字符串的某个字符。

很好的代码 没用了 真可惜

原文:http://www.cnblogs.com/qinqiu/p/4512455.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!