package myclasses; public class StringUtil { public static String toHangul(String str) { String value = null; if(str == null) { return null; } try { value = new String(str.getBytes("8859_1"),"KSC5601"); } catch(java.io.UnsupportedEncodingException e) { System.err.print(e); } return value; } public static String toEng(String str) { String value = null; if(str == null) { return null; } try { value = new String(str.getBytes("KSC5601"),"8859_1"); } catch(java.io.UnsupportedEncodingException e) { System.err.print(e); } return value; } public static int match(String s,char m[],int start) { if(start < 0 || start > s.length()) { return -1; } for(int i=0; i< m.length; i++) { if(s.charAt(start+i) !=m[i]) { return match(s,m,s.indexOf(m[0],start+i)); } } return start; } }