下面是部分代码:问题就出现在: 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");
}
这个在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");
}
解决方案 »
- java swing 弹出框的疑惑。。
- Graphics中drawString方法?
- 调试了很多遍了 求教各位高手
- Graphics2D的drawImage()的图片翻转???????
- java打开网络中的流, 如何设置最长时间?
- 高分求救(急,急,急!)用Ant如何删除某文件夹(包括子文件夹)下,指定类型的文件
- 请问,如何在一幅图片上修改像素?
- 关于java中时间的问题。
- 线程的问题!
- MD5加密函数在netscape中运行的时候抛出NullPointer异常,但是在IE中运行是正常的,请大虾提示!!!(代码内详)
- 在JAVA中用zipOutputStream类把文件打包成zip文件不支持中文如何解决?急!!!
- 请问大于127的ascii怎么转成byte或者char
2。replaceALL在jdk1.4中有,在jdk1.3中就只有replace
估计两个系统下的jdk环境不同?
程序中汉字的显示对程序的运行有没有影响呢?如果没有影响,为什么要关注.class呢?
如果是jdk1.4,没理由找不到replaceAll。你试试找的到replace不?如果找的到,就用循环实现吧