我的 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);
}
}
}