下面是部分代码:问题就出现在: 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输出中文到文件时总是变成?号的求助
- 给你 几个 字母 求它的全排列 ~~!
- System.out.println("aa|bb|cc".split("|").length); 的结果为什么是9不是3?
- 问个菜鸟问题,急!
- 我的Resultset 结果集 为什么重复的结果有 晕 大家帮我看看 小弟急100分
- 关于无包名类的导入问题
- java的四个程序
- 请前辈们给点指点!!
- 拼音排序汉字,急急急!谢谢
- 怎样实现JAVA SE 传对象至servlet----不是APPLET和servlet
- 在JAVA中用zipOutputStream类把文件打包成zip文件不支持中文如何解决?急!!!
- 请问大于127的ascii怎么转成byte或者char
2。replaceALL在jdk1.4中有,在jdk1.3中就只有replace
估计两个系统下的jdk环境不同?
程序中汉字的显示对程序的运行有没有影响呢?如果没有影响,为什么要关注.class呢?
如果是jdk1.4,没理由找不到replaceAll。你试试找的到replace不?如果找的到,就用循环实现吧