下面是部分代码:问题就出现在:        Source = Source.replaceAll("&nbsp ", "");
这个在WIN下编译是顺利通过的,而且运行完全正确    public void cityweather(String Source)
    {
        Source.trim();
        String excuteString = null;
        int debut = Source.indexOf("<");
        for(int fin = Source.indexOf(">"); debut >= 0 && fin > 0;)
        {
            debut = Source.indexOf("<");
            fin = Source.indexOf(">");
            if(debut < 0)
                break;
            if(debut >= fin)
                debut = 0;
            excuteString = null;
            excuteString = Source.substring(0, debut);
            excuteString.trim();
            excuteString = excuteString + "" + Source.substring(fin + 1).trim();
            Source = excuteString;
        }        Source = Source.replaceAll("&nbsp ", "");
        System.out.print("过滤后:" + Source + "\n");
     }

解决方案 »

  1.   

    1。.class文件显示为乱吗不奇怪呀
    2。replaceALL在jdk1.4中有,在jdk1.3中就只有replace
    估计两个系统下的jdk环境不同?
      

  2.   

    请教: dophin1003(浮云~~~) ,这2个问题我该怎么修改?
      

  3.   

    还有,linux中确实是jdk1.4.2啊,那怎么也没有replaceALL?
      

  4.   

    不太明白。
    程序中汉字的显示对程序的运行有没有影响呢?如果没有影响,为什么要关注.class呢?
    如果是jdk1.4,没理由找不到replaceAll。你试试找的到replace不?如果找的到,就用循环实现吧
      

  5.   

    程序的汉字主要是发消息的,本地显示都是乱码,用户收到的消息也是乱码。replace也找不到
      

  6.   

    我查了一下,用ENV命令所有环境都是J2SDK1.4.2,可是用java -version 显示 java version 1.1,这个有问题吗?可是库使用的是J2SDK1.4.2啊