?? stringutil.java
字號:
package com.dut.logic.util;
public class StringUtil {
static public String utf_zhuan(String tr2) {
String result = null;
byte temp[];
try {
temp = tr2.getBytes("ms932");
result = new String(temp, "iso-8859-1");
} catch (Exception e) {
System.out.println(e);
}
return result;
}
/**
* 該方法用于頁面到頁面的字符轉(zhuǎn)換
* @param tr1
* @return
*/
static public String trans(String tr1) {
String result = null;
byte temp[];
try {
temp = tr1.getBytes("iso-8859-1");
result = new String(temp, "UTF-8");
} catch (Exception e) {
System.out.println(e);
}
return result;
}
/**
* 該方法用于數(shù)據(jù)庫到頁面的字符轉(zhuǎn)換
* @param tr1
* @return
*/
static public String trans_date(String tr2) {
String result = null;
byte temp[];
try {
temp = tr2.getBytes("iso-8859-1");
result = new String(temp, "ms932");
} catch (Exception e) {
System.out.println(e);
}
return result;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -