title: facing issue with int to char conversion
body: <p>I am facing an issue probably with int to char conversion.</p>
  
  <p>What i am doing?</p>
  
  <pre><code>&gt; Create random password using Membership.createPassword()
  &gt; Create random digit.
  &gt; Convert password to array
  &gt; Get random array index and replace character with int
  </code></pre>
  
  <p>I have following code to generate random password with 1 digit at least.</p>
  
  <pre><code>GetRandomPassword(10, 1);
  
  private string GetRandomPassword(int length, int numberOfNonAlphanumericCharacters)
  {
      int index = new Random().Next(1, 9);
      string password = Membership.GeneratePassword(length, numberOfNonAlphanumericCharacters);
      char[] charArray = password.ToCharArray();
      charArray[index] = Convert.ToChar(index);
      string newPassword = new string(charArray);
      return newPassword;
  }
  </code></pre>
  
  <p>However, the issue i am facing is with this line </p>
  
  <pre><code>charArray[index] = Convert.ToChar(index);
  </code></pre>
  
  <p>It does not store digit at given index but it stores ascii character like '\a'.
  Why? 
  please advise, </p>
  
  <p><strong>How i can store number to char array at random index?</strong></p>