去掉字符串中間空格的方法
来源:互联网 发布:ubuntu拼音输入法无效 编辑:程序博客网 时间:2024/06/05 11:24
Function xuankong(str)Dim resultDim jj=len(str)result=""Dim iFor i=1 To j Select Case mid(str,i,1) Case ""<"" result=result+""<"" Case "">"" result=result+"">"" Case chr(34) result=result+"" Case ""&"" result=result+""&""'以上代???一些html?? Case chr(255)'防止特殊空格 result=result Case chr(13)'防止回?符 result=result+""Case chr(32)'防止?行符 result=result+"" Case Else result=result+mid(str,i,1) End SelectNextxuankong=resultEnd Function這個是ASP實現,思路可用於JSPpublic String filterHtml(String value){value=value.replaceAll("&","&");value=value.replaceAll("<","<");value=value.replaceAll(">",">");value=value.replaceAll(" "," ");value=value.replaceAll("'","'");value=value.replaceAll("/"",""");value=value.replaceAll("/n","
");}在頁面中 string temp=filterHtml(request.getParameter(temp));
");}在頁面中 string temp=filterHtml(request.getParameter(temp));
- 去掉字符串中間空格的方法
- JAVA中去掉字符串空格的方法
- Python去掉字符串中空格的方法
- JAVA中去掉字符串空格的方法
- Python去掉字符串中空格的方法
- python去掉字符串中空格的方法
- Python去掉字符串中空格的方法
- python去掉字符串中空格的方法
- string类的GetCharEnumerator方法去掉字符串中空格
- Java字符串中去掉空格的几种方法
- Android JAVA中去掉字符串空格的方法
- [Java]去掉字符串中空格的几种方法
- 去掉字符串中空格的四种方法
- c#中去掉字符串空格方法
- c#中去掉字符串空格方法
- c#中去掉字符串空格方法
- c#去掉字符串空格的的方法
- 去掉字符串中空格
- So.
- Htmler.Table
- JS解决PNG图片在IE6下背景不透明 DD_belatedPNG_0.0.8
- 按钮控件(button)
- 编辑框控件(edit)
- 去掉字符串中間空格的方法
- lightbox2.02 很漂亮的JS图片特效
- 滚动条控件(ScrollBar)
- Grub2的恢复
- Oracle Data Gurad -- Logical Standby 相关说明
- 程序员的开始
- 组合框控件(combobox)
- 列表框控件(listbox)
- X64移植编译常见问题