title: How to search for specific char in an array and how to then manipulate that index in c#
body: <p>Okay, so I'm creating a hangman game and everything functions so far, including what I'm TRYING to do in the question. </p>
  
  <p>But it feels like there is a much more efficient method of obtaining the char that is also easier to manipulate the index. </p>
  
  <pre><code>protected static void alphabetSelector(string activeWordAlphabet)
      {
          char[] activeWord = activeWordAlphabet.ToCharArray();
  
          string activeWordString = new string(activeWord);
          Console.WriteLine("If you'd like to guess a letter, enter the letter. \n 
          If you'd like to guess the word, please type in the word. --- testing answer{0}", 
          activeWordString);
  
          //Console.WriteLine("For Testing Purposes ONLY");
          String chosenLetter = Console.ReadLine();
          //Char[] letterFinder = Array.FindAll(activeWord, s =&gt; s.Equals(chosenLetter));
          //string activeWordString = new string(activeWord);
  
          foreach (char letter in activeWord);
          {
              if(activeWordString.Contains(chosenLetter))
              {
                  Console.WriteLine("{0}", activeWordString);
                  Console.ReadLine();
  
              }
  
              else
              {
                  Console.WriteLine("errrr...wrong!");
                  Console.ReadLine();
  
              }
  
  
  
          }
  
  
  
      }
  </code></pre>
  
  <p><em>I have broken up the code in some areas to prevent the reader from having to scroll sideways. If this is bothersome, please let me know and I'll leave it in the future.</em></p>
  
  <p>So this code will successfully print out the 'word' whenever I select the correct letter from the random word <em>(I have the console print the actual word so that I can test it successfully each time).</em> It will also print 'wrong' when I choose a letter NOT in the string. </p>
  
  <p>But I feel like I should be able to use the 
      Array.FindAll(activeWord, ...)
  functionality <em>or some other way</em>. But every time I try and reorder the arguments, it gives me all kinds of different errors and tells me to redo my arguments. </p>
  
  <p>So, if you can look at this and find an easier method of searching the actual array for the user-selected 'letter', please help!! Even if it's not using the Array.FindAll method!!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Okay, it seems like there's some confusion with what I've done and why I've done it. </p>
  
  <p>I'm ONLY printing the word inside that 'if' statement to test and make sure that the foreach{if{}} will actually work to find the char inside the string. But I ultimately need to be able to provide a placeholder for a char that is successfully found, as well as being able to 'cross out' the letter (from the alphabet list not shown here). </p>
  
  <p>It's hangman - surely you guys know what I'm needing it to do. It has to keep track of which letters are left in the word, which letters have been chosen, as well as which letters are left in the entire alphabet. </p>
  
  <p>I'm a 4-day old newb when it comes to programming, so please. . . I'm only doing what I know to do and when I get errors, I comment things out and write more until I find something that works. </p>