我有一个文本文件,当我使用Bufferedreader读取它时,它仅捕获并存储单词oshane,但我希望由缓冲区读取oshane.png。你能告诉我我做错了吗Name.txt:photo:oshane.png
这是我使用的方法
while ((str = reader.readLine()) != null) {
int pos = str.indexOf(":");
String temp = str.substring(pos + 1, str.length());
if ((str.contains("photo"))) {
photo = temp;
}
while ((str = reader.readLine()) != null) {
name = str.split("\\:")[1];
}