码迷,mamicode.com
首页 > 其他好文 > 详细

很好的代码 没用了 真可惜

时间:2015-05-18 18:25:58      阅读:100      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!