FileReader f0 = new FileReader("1.html");
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(f0);
while((temp1=br.readLine())!=null)
{
sb.append(temp1);
}
String para = sb.toString().replaceAll("<br>","\n");
String textonly = Jsoup.parse(para).text();
System.out.println(textonly);
FileWriter f1=new FileWriter("1.txt");
char buf1[] = new char[textonly.length()];
textonly.getChars(0,textonly.length(),buf1,0);
for(i=0;i<buf1.length;i++)
{
if(buf1[i]=='\n')
f1.write("\r\n");
f1.write(buf1[i]);
在制作新的文本文件时,这段代码是多行的,我希望文本文件应该只有一行。我怎样才能做到这一点。