trim 的问题,在线求助!!! javascript没有这个功能的要自己写一个函数的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function ReplaceDemo(){ var r, re; // 声明变量。 var ss = "The man hit the ball with the bat.\n"; ss += "while the fielder caught the ball with the glove."; re = /\s/g; // 创建正则表达式模式。 r = ss.replace(re, ""); // 用 "" 替换 空字符。 return(r); // 返回替换后的字符串。} String.prototype.trim = function() { return (this.replace(/^\s+|\s+$/g,""));}alert(" cloudchen ".trim().bold()) 梅花雪树2.0 自定义节点图标 页面中很多js会导致速度慢吗? 关于split按正则分割字串 一个按键上的特效 求方法 谢谢 利用javascript怎样屏蔽浏览器菜单? 为什么还会触发 ◎◎如何判断一个form是否存在??◎◎ 知道一个FOrm的text,如何得知该text所在的前一个td中的文字 两个列表框的移动,错在哪里,请各位帮着看看? 如何使网页端支持avi格式视频播放 请教一个隐藏IE 工具条的代码! 想在网页中生成一个扇状统计图?怎么实现?
var r, re; // 声明变量。
var ss = "The man hit the ball with the bat.\n";
ss += "while the fielder caught the ball with the glove.";
re = /\s/g; // 创建正则表达式模式。
r = ss.replace(re, ""); // 用 "" 替换 空字符。
return(r); // 返回替换后的字符串。
}
return (this.replace(/^\s+|\s+$/g,""));
}
alert(" cloudchen ".trim().bold())