JS 利用正则表达式替换字符串 博客分类: JavaScript 学习资料 Java代码 收藏代码 JS 利用正则表达式替换字符串 var data = "123123,213,12312,312,3,Caat,cat,dsfsdfs,"; -])*t\b/ig; //•g(全文查找):•i(忽略大小写):•m(多行查找) var res = data.replace(reCat,"AAA"); 输出:,,,,,AAA,AAA,dsfsdfs, var data =
我来分享一个快速设置背景的js (需要jq支持!) 快速切图铺页面用---就是不需要手动输入背景图的长宽 自动获取背景图的长宽 : <div class="wrap"> <div style="background: url(images/by_01.jpg) no-repeat top center;"></div> <div style="background: url(images/by_02.jpg) no
// // MainScene.hpp // helloworld // // Created by apple on 16/9/19. // // #ifndef MainScene_hpp #define MainScene_hpp #include <stdio.h> #include "cocos2d.h" using namespace cocos2d; //定义一个场景类 class MainScene : public cocos2d::Layer{ priv