Chinaunix首页 | 论坛 | 博客
  • 博客访问: 147352
  • 博文数量: 20
  • 博客积分: 1425
  • 博客等级: 上尉
  • 技术积分: 265
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-27 18:42
文章分类

全部博文(20)

文章存档

2011年(1)

2010年(1)

2009年(2)

2008年(16)

我的朋友

分类: Java

2008-04-10 08:12:37

public class Ascii {
    public static void main(String args[]) {
        String str;
        if (args != null && args.length > 0) {
            str = args[0];
        } else {
            str = "0068%u0074%u0074%u0070%u003A%u002F%u002F%u0032%u0063%u0070%u0069%u0063%u0031%u0032%u002E%u0079%u006F%u0075%u0072%u006F%u0075%u0072%u002E%u0063%u006F%u006D%u002F%u006A%u002F%u8857%u9738%u2162%u002F%u8857%u9738%u2162%u005F%u0043%u0048%u0030%u0030%u0031%u002F%u0053%u0046%u0049%u0049%u0049%u004E%u0065%u0077%u0047%u0065%u006E%u0065%u0072%u0061%u0074%u0069%u006F%u006E%u005F%u0030%u0030%u0031%u005F%u0030%u0034%u0035%u002E%u006A%u0070%u0067";
        }
        String strs[] = str.split("%u");
        char[] chars = new char[strs.length];
        
//        for (int i=0; i
//            if (strs[i].equals("")) {
//                System.out.println(i);
//            }
//        }

        for (int i=0; i<strs.length; i++) {
            chars[i] = (char)Integer.parseInt(strs[i], 16);
        }
        
        String result = new String(chars);
        System.out.println(result);
    }
}

阅读(1437) | 评论(1) | 转发(0) |
0

上一篇:诡异的错误

下一篇:Linux文件解压缩

给主人留下些什么吧!~~

chinaunix网友2009-11-26 09:44:16

领教了www.louqu.net谢谢