我有一个正在使用BufferedReader
阅读的文本文件。它仅捕获并存储单词 oshane ,但我希望 oshane.png 被缓冲区读取。你能告诉我我在做什么错吗?
Name.txt:
photo:oshane.png
这是我的方法:
try {
while ((str = reader.readLine()) != null) {
int pos = str.indexOf(":");
String temp = str.substring(pos + 1,str.length());
if ((str.contains("photo"))) {
photo = temp;
}