title: Why my string.Remove() is not working as expected?
body: <p>I am trying to solve this problem of finding if two words are anagrams of one another (if we rearrange a string, it matches second string). </p>
  
  <p>Based on <a href="https://stackoverflow.com/questions/8963738/remove-single-character-from-a-string"><strong>Remove single character from a string</strong></a> I built my own function:</p>
  
  <pre><code>public class AreAnagrams
  {
          public static bool AreStringsAnagrams(string FirstString, string SecondString)
          {
              if (FirstString == null || b == null)
                  return false;
  
              if (FirstString.Length != SecondString.Length)
                  return false;
  
              for (int i = 0; i &lt; SecondString.Length; i++)
              {
                  if (FirstString.IndexOf(SecondString[i]) == -1)
                      return false;
                  else
                      FirstString.Remove(FirstString.IndexOf(SecondString[i]), 1); // Here it does not modify FirstString, even if I put 2nd parameter as 1
              }
  
              if (FirstString.Length &gt; 0)
                  return false;
  
              return true;
          }
  
      public static void Main(string[] args)
      {
          Console.WriteLine(AreStringsAnagrams("neural", "unreal"));
      }
  }
  </code></pre>
  
  <p>On my watch I see <code>FirstString</code> still as is. What is the problem? Please and thank you </p>