通过本文主要向大家介绍了java去除全角空格,全角空格,全角空格怎么打,全角空格和半角空格,全角空格复制等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
<script language="javascript">
<!--
String.prototype.trim = function(){
return this.replace(/^( |[\s ])+|( |[\s ])+$/g, "" );
}
alert("---"+ " this is a test kwgkwg ".trim() + "---");
/ --></script>
1、去段首段尾的空格(包括半角的空格代码 和全角的空格" ")
2、段中的空格(包括半角的空格代码 和全角的空格" ")给予保留! </div>
<!--
String.prototype.trim = function(){
return this.replace(/^( |[\s ])+|( |[\s ])+$/g, "" );
}
alert("---"+ " this is a test kwgkwg ".trim() + "---");
/ --></script>
1、去段首段尾的空格(包括半角的空格代码 和全角的空格" ")
2、段中的空格(包括半角的空格代码 和全角的空格" ")给予保留! </div>