stringtrans.java
来自「java编写的一个bbs论坛系统,可以myeclipse打开查看,有一定的参考价」· Java 代码 · 共 49 行
JAVA
49 行
package com.wsy.struts.util ;import java.io.*;public class StringTrans{ public static String tranA(String chi) { String result=null; byte temp[]; try { temp=chi.getBytes("UTF-8"); result=new String(temp); }catch(UnsupportedEncodingException e) { System.out.println(e.toString()); } return result; } public static String tranB(String chB) { String result=null; byte temp[]; try { temp=chB.getBytes("UTF-8"); result=new String(temp,"iso-8859-1"); }catch(UnsupportedEncodingException e) { System.out.println(e.toString()); } return result; } public static String tranC(String chB) { String result=null; byte temp[]; try { temp=chB.getBytes("iso-8859-1"); result=new String(temp,"UTF-8"); }catch(UnsupportedEncodingException e) { System.out.println(e.toString()); } return result; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?