Hi,
I have a list of strings For Eg: s1 = "20 - 30" , s2 = "10 - 30", s3 = "30 - 30".
Now, I have a text file which has some 100 lines. So , I have to read each line of the fiel and check if the line contains any of the above strings. If yes, I will do implement my logic.
Can you please provide me any other solution than the below which I thought.
My Logic:
List<String> list = new ArrayList<String>();
list.add(s1);list.add(s2);list.add(s3);
Iterator i = list.iterator();
Reading the each line logic
{
for each line
{
While(i.hasnext())
{
if(line.contains(i.next()))
{
// implement your logic
}
}
}
let me know any thing shortest way than this.
Thanks,
Adithya