title: How do I find the letters of a certain word within a Character array in Java?
body: <p>I need to compare the characters from two different Character Arrays to find the Hidden word inputted by the user. </p>
  
  <p>The goal is to input 2 Strings and to find a word scrambled within the other. 
  Ex. The word "tot" is scrambled in the word "tomato" </p>
  
  <p>With the help of some people of the forums, I have implemented character arrays to store the user Strings, but I do not know a way to check each array for the characters needed. I have tried the code below but it always results in the program not being able to find the word. If anyone could provide a better method or solution I'd highly appreciate it. </p>
  
  <pre><code>public static void main(String[] args) {
      input = new Scanner(System.in);
  
      System.out.println("Please enter a word"); 
      String word = input.next();
      char[] charOfWrds = word.toCharArray();
  
      System.out.println("Please enter a hidden word you would like to search for");
      String search = input.next();
      char[] charOfSrch = search.toCharArray();
  
      if (isContains(charOfWrds, charOfSrch))   
      { 
          System.out.print("The word " + search + " is found in the word " + word);
      } 
      else 
      {
          System.out.print("The word was not found in " + word); 
      }
  }
  public static Boolean isContains(char[] charOfWrds, char[] charOfSrch) {
      int count = 0;
      for (char cha : charOfWrds) 
      {
          for (char chaaa : charOfSrch) 
          {
              if (cha == chaaa)
                  count++;
          }
      }
      if (count == charOfSrch.length)
      {
          return true;
      }
      return false;
  }
  </code></pre>