title: Java Searching Through a String
body: <p>So I want to search through a string to see if it contains the substring that I'm looking for. This is the algorithm I wrote up:</p>
  
  <pre><code>    //Declares the String to be searched
      String temp = "Hello World?";
  
      //A String array is created to store the individual 
      //substrings in temp
      String[] array = temp.split(" ");
  
      //Iterates through String array and determines if the
      //substring is present
      for(String a : array)
      {
          if(a.equalsIgnoreCase("hello"))
          {
              System.out.println("Found");
              break;
          }
          System.out.println("Not Found");
      }
  </code></pre>
  
  <p>This algorithm works for "hello" but I don't know how to get it to work for "world" since it has a question mark attached to it.</p>
  
  <p>Thanks for any help!</p>