JAVA从TextArea读取字符串

来源:百度知道 编辑:UC知道 时间:2024/05/21 02:51:56
try {
bin = new BufferedReader(new FileReader(note.getText()));//可能是这里不能用filereader吧.有没东西可以替换的.

while (bin.readLine() != null) {
count = count + 1;
}
} catch (IOException e0) {
System.out.println("no------------------1");
}

不想写代码了,累了,只告诉你该注意的一些东西吧:
读的时候按照行来读 br.readline();
然后写到一个文件里的时候注意把里面的换行/n替换成'/r/n' 如若不然 乱码