「catch」句は無視できますか? 私はこのコードを持っています。私がしたいのは、特定の文字列を含むすべての単語をスキャンし、それらを String res に保存することです。
しかし、私が今持っているコードは、「catch」句が中断するとループが停止するため、ループを反復処理しません。catch 句を無視して、ファイルの最後に到達するまで「try」をループさせ続ける方法はありますか?
String delimiter = " - ";
String[] del;
String res = new String();
if(curEnhancedStem.startsWith("a"))
{
InputStream inputStream = getResources().openRawResource(R.raw.definitiona);
try {
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
String s = in.readLine();
while(s != null)
{
s = in.readLine();
del = s.split(delimiter);
if (del[0].contains(curEnhancedStem))
{
res = res + s + "\n\n";
}
}
return res;
}
catch (Exception e) {
// nothing to do here
}
}