当前位置: 首页 > news >正文

做聊天网站的视频教程镇江网站建设镇江

做聊天网站的视频教程,镇江网站建设镇江,赣州招标网官网,网页界面设计的功能性主要体现在信息的哪两个方面本文#xff0c;我们接着之前的框架继续扩展#xff0c;这次扩展了一共有5个与字符串位置相关的方法 between( left, right ) 返回两个字符串之间的内容#xff0c; 如果第二个参数没有传递#xff0c;返回的是找到的第一个参数 之后 到 字符串结尾的所有字符串 如果第二个…本文我们接着之前的框架继续扩展这次扩展了一共有5个与字符串位置相关的方法 between( left, right ) 返回两个字符串之间的内容 如果第二个参数没有传递返回的是找到的第一个参数 之后 到 字符串结尾的所有字符串 如果第二个参数传递了但是从left这个位置查找不到就返回空字符串 例子 G( ghost wu tell you how to learn js ).between( tell, learn ).s    返回的是tell和learn之间的字符串, 结果为:you how to G( ghost wu tell you how to learn js ).between( tell ).s 返回的是tell后面所有的字符串结果为:you how to learn js G( ghost wu tell you how to learn js ).between( tell, wu ).s 返回空字符串 chompLeft( prefix ) 例子:返回以prefix开头 到 字符串结尾的所有字符串 G( ghost wu tell you how to learn js ).chompLeft( tell ).s; //ghost wu tell you how to learn js G( ghost wu tell you how to learn js ).chompLeft( ghost ).s; //wu tell you how to learn js startWith( prefix ): 判断是否以prefix这个字符串开始 endWith( prefix ): 判断是否以prefixe这个字符串结尾 G( ghost wu tell you how to learn js---ghost wu ).startWith(wu);//false G( ghost wu!asbc# ghost wu ).endWith(wu);//true chompRight( prefix ) 例子:返回从字符串开始到以prefix结尾之间的字符串 G( ghost wu tell you how to learn js---ghost wu ).chompRight(wu).s;//ghost wu tell you how to learn js---ghost 1 ; (function (window, undefined) {2 function init(obj, s) {3 if (s ! null s ! undefined) {4 if (typeof s string) {5 obj.s s;6 } else {7 obj.s s.toString();8 }9 } else {10 obj.s s;11 }12 }13 14 function G(s) {15 init(this, s);16 }17 18 function GhostWu(s) {19 return new G(s);20 }21 22 var sProto String.prototype;23 G.prototype {24 constructor: G,25 capitalize: function () {26 return new this.constructor(this.s.slice(0, 1).toUpperCase() this.s.substring(1).toLowerCase());27 },28 trimLeft: function () {29 var s;30 if (sProto.trimLeft undefined)31 s this.s.trimLeft();32 else33 s this.s.replace(/^\s/g, );34 return new this.constructor(s);35 },36 trimRight: function () {37 var s;38 if (sProto.trimRight undefined)39 s this.s.trimRight();40 else41 s this.s.replace(/\s$/g, );42 return new this.constructor(s);43 },44 trim: function () {45 var s;46 if (typeof sProto.trim undefined) {47 s this.s.replace(/^\s|\s$/g, );48 } else {49 s this.s.trim();50 }51 return new this.constructor(s);52 },53 camelize: function () {54 var s this.trim().s.replace(/(\-|_|\s)(.)?/g, function (s0, s1, s2) {55 return (s2 ? s2.toUpperCase() : );56 });57 return new this.constructor(s);58 },59 dasherize: function () {60 var s this.trim().s.replace(/[_\s]/g, -).replace(/([A-Z])/g, -$1).replace(/-/g, -).toLowerCase();61 return new this.constructor(s);62 },63 between: function (left, right) {64 var s this.s;65 var startPos s.indexOf(left);66 var endPos s.indexOf(right, startPos left.length);67 if (endPos -1 right ! null)68 return new this.constructor()69 else if (endPos -1 right null)70 return new this.constructor(s.substring(startPos left.length))71 else72 return new this.constructor(s.slice(startPos left.length, endPos));73 },74 chompLeft: function (prefix) {75 var s this.s;76 if (s.indexOf(prefix) 0) {77 s s.slice(prefix.length);78 return new this.constructor(s);79 } else {80 return this;81 }82 },83 startWith: function () {84 var prefixes [].slice.call(arguments, 0);85 if (this.s.indexOf(prefixes[0], 0) 0) return true;86 return false;87 },88 endWith: function () {89 var prefixes [].slice.call(arguments, 0),90 pos 0;91 while (pos ! -1) {92 if (this.s.indexOf(prefixes[0], pos) (this.s.length - prefixes[0].length)) return true;93 pos this.s.indexOf(prefixes[0], pos prefixes[0].length);94 }95 return false;96 },97 chompRight: function (suffix) {98 if (this.endWith(suffix)) {99 var s this.s; 100 s s.slice(0, s.length - suffix.length); 101 return new this.constructor(s); 102 } else { 103 return this; 104 } 105 } 106 }; 107 108 window.G GhostWu; 109 })(window, undefined);
http://www.huolong8.cn/news/241389/

相关文章:

  • 南昌企业建站现在做外贸前景如何
  • 建设专业网站所需设备网校平台搭建
  • 营销型网站建设的利与弊wordpress域名修改
  • 做博客网站赚钱吗自己买服务器做网站
  • 广州网匠营销型网站建设公司深圳大事件
  • 西安网站开发托管代运营网站精简布局
  • 建网站需要什么手续烟台网站建设 共赢
  • 幻灯网站源码刷死粉网站推广
  • 衡水哪儿做wap网站和coser做网站
  • 怎么在百度上能搜到自己的网站有没有做的很炫的科技型网站
  • 网站运营目的南通网站排名公司
  • 遵义企业网站建设长沙网站建设服务
  • 商标代理公司班级优化大师app下载学生版
  • 专业网站设计制合肥作网站广告投放
  • 什么网站教人做3d效果图做国外商品的网站
  • 上海 网站建设 500强夷陵网
  • 网站建设平台官网要点有哪些php网页设计培训
  • 苏州微网站建设公司哪家好凡客网站登录
  • 永久免费的网站服务器有哪些平台学广告设计好就业吗
  • 做微信小程序和网站那个简单吉林智能网站建设价格
  • 换网站后台开发系统需要什么技术
  • 软件下载网站哪个最安全网站建设手机端管网
  • 网站备案要钱吗简述网络推广5种方法
  • 网站建设价格比较wordpress修改底部
  • wordpress中文网站模板wordpress 友好速搭
  • 免费制作图片加文字seo网站页面优化包含
  • 网站建设误期违约金赔偿限额html笔记完整版
  • 做seo的网站利川网站建设
  • 网站设计标准尺寸做营销的网站
  • 站长统计app网站个人房产网签查询系统