Stringオブジェクトに次のようなデータがあります
Scanner Inlist 1,2,3
Resolved scan set NotEqual to Non Scan Set
Area of intrest equal to Total Intrest
Initial responder Inlist enter values
ここで、各行を読んだときに単語(Inlist、NotEqual、Inlist)が見つかった場合は、その行を分割して次の行を読む必要があります。
Output would be:
Scanner
Resolved scan set
Area of intrest
Initial responder
今まで私が試したことは
String filterstringobj=promtchild.toString();
StringTokenizer str=new StringTokenizer(filterstringobj,"");
while(str.hasMoreTokens())
{
String Inlistremove=str.nextToken("InList");
if(Inlistremove.length()!=0)
{
System.out.println(Inlistremove);
if(Inlistremove.equalsIgnoreCase("InList") &&
Inlistremove.equalsIgnoreCase("NotEqual") &&
Inlistremove.equalsIgnoreCase("Equal")
)
{
System.out.println(Inlistremove);
}
}
}