?? chstr.java
字號:
package com.zkdz.core;
public class ChStr {
/*
* 轉換字符串
*/
public String toChinese(String strvalue){
try{
if(strvalue==null){
strvalue="";//當strvalue為null時,將strvalue賦值為空
}else{
strvalue=new String(strvalue.getBytes("ISO8859_1"),"GBK");
//將字符串轉換為中文
strvalue=strvalue.trim();//去除字符串的首尾空格
}
}catch(Exception e){
strvalue="";
}
return strvalue;
}
/*
* 過濾危險字符
*/
public final String filterStr(String str){
str=str.replace(";", ""); //替換字符串中的;為空
str=str.replace("&", "&");//替換字符串中的&為&
str=str.replace("<", "<");//替換字符串中的<為<
str=str.replace(">", ">");//替換字符串中的>為>
str=str.replace(",", ""); //替換字符串中的,為空
str=str.replace("--", ""); //替換字符串中的--為空
str=str.replace("/", "");//替換字符串中的/為空
str=str.replace("%", "");//替換字符串中的%為空
return str;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -