13 Replies Latest reply on Apr 25, 2007 10:59 PM by 807606

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

    807606
      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?