This discussion is archived
13 Replies Latest reply: Apr 25, 2007 3:59 PM by 807606 RSS

How to find a String in a text file..........

807606 Newbie
Currently Being Moderated
public void getOptions(String name){     
          
          boolean equal=false;
          
          for(int j=1;j<=lines;j++)          
               
               {
               s=totalfile[j];
          
               if(name.equalsIgnoreCase(totalfile[j]))          
                    
                    System.out.println("name found" + equal);
                         
               }
               
I have a text file in an array called totalfile[j]. I am able to print the lines of the text file.

But i want to pass a "string" an check whether it exists in the array totalfile[   j  ] or not.

iam using the above method but its not printing anything??????

What is the error here?