使用js的正则表达式删除字符串两边的空格
来源:互联网 发布:java上传excel并解析 编辑:程序博客网 时间:2024/05/17 23:12
SCRIPT LANGUAGE="JavaScript"> <!-- //出处:网上搜集 // Trim() , Ltrim() , RTrim() String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.LTrim = function() { return this.replace(/(^\s*)/g, ""); } String.prototype.RTrim = function() { return this.replace(/(\s*$)/g, ""); } //--> </SCRIPT> <input type="text" value=" 前后都是空格 " id="space"> <input type="button" value="去前后空格" onclick="javascript:document.getElementById('space').value=document.getElementById('space').value.Trim();document.getElementById('space').select();"> <input type="button" value="去前空格" onclick="javascript:document.getElementById('space').value=document.getElementById('space').value.LTrim();document.getElementById('space').select();"> <input type="button" value="去后空格" onclick="javascript:document.getElementById('space').value=document.getElementById('space').value.RTrim();document.getElementById('space').select();"> <input type="button" value="还原" onclick="javascript:document.getElementById('space').value=' 前后都是空格 ';"> <a href="http://www.yaoasnsi.com" target="_blank">访问yaosansi.com</a>
0 0
- 使用js的正则表达式删除字符串两边的空格
- js中去掉字符串两边的空格
- js去掉字符串两边的空格
- Java正则表达式 : 将字符串两边的空格(包括全角和半角)去掉,字符串内部的空格不能去】
- 去处字符串两边的空格
- java用正则表达式删除字符串前、后的空格。
- 用JS去掉字符串中的空格(正则表达式的应用)
- 使用正则表达式删除空格后的数字
- php 使用正则表达式删除多余的空格
- JS去掉字符串两边(左右)的空格(js去空格)
- 正则表达式的使用--去除字符串中空格
- 去掉字符串左右两边多余的空格
- JavaScript去掉字符串两边空格的方法
- 去掉字符串左右两边多余的空格 .
- Java去掉字符串两边的空格
- extjs 去除字符串两边的空格:
- JQuery去掉字符串两边的空格
- 去除字符串左右两边的空格
- excel格式 _ * #,##0_ ;_ * -#,##0_ ;_ * "-"_ ;_ @_
- Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
- mysql 远程连接速度慢的解决方案
- Hive 内建操作符与函数开发
- nyoj-473-A^B Problem
- 使用js的正则表达式删除字符串两边的空格
- MySQL错误:You are using safe update mode and you tried to update a table without a WHERE that uses
- 放飞艺术的梦想,展望美好的未来
- 收集资源
- 东软睿道实训日记——第八天
- 关于延迟调用
- POM.xml详解
- 自娱自乐
- linux todo