-
-
-
- public class UnicodetoChar {
- private String theString;
-
- public UnicodetoChar(String theString){
- this.theString = theString;
- }
-
- public String convert(){
- int i=0;
- String s = new String ();
- String thechar = new String();
- while(i<theString.length()){
- while(i<theString.length()&&(theString.charAt(i)!=' ')){
- thechar += theString.charAt(i++);
- }
- s+=(char)Integer.parseInt(thechar);
- thechar ="";
- i++;
- }
- return s;
- }
- }
-
-
-
-
-
- public class ChartoUnicode {
- private String theString;
-
- public ChartoUnicode(String aString){
- theString = aString;
- }
-
- public String convert(){
- int i,j;
- String chartodigit = new String();
- for(i=0;i<theString.length();i++){
- j = (int)theString.charAt(i);
- chartodigit+=j+" ";
- }
- return chartodigit;
- }
- }
posted on
2013-02-14 18:43
点石互动
阅读(
178)
评论()
编辑
收藏
举报