テキスト ファイルから読み取ろうとしていますが、これらの文字列は異なる属性に分かれていますが、最初の分割後にどのようにすればよいかわかりません。
これが私のコードです:getType()
文字列のオフセットは何ですか?
try {
InputStream is = context.getAssets().open("Autoeval");
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
//Skips lines
for (int i = 0; i< questionNumber; i++) {
reader.readLine();
}
question = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
}
public String getId() {
return question.substring(0, question.indexOf(";"));
}
public String getType() {
return question.substring(question.indexOf(";"));
}