title: using .replace to replace a word in text document (c#)
body: <p>currently have the following code:</p>
  
  <pre><code>    string[] fileLineString = File.ReadAllLines(Server.MapPath("~") + "/App_Data/Users.txt");
  
      for (int i = 0; i &lt; fileLineString.Length; i++)
      {
          string[] userPasswordPair = fileLineString[i].Split(' ');
  
          if (Session["user"].ToString() == userPasswordPair[0])
          {
              userPasswordPair[i].Replace(userPasswordPair[1], newPasswordTextBox.Text);
          }
      }
  }
  </code></pre>
  
  <p>the text file is set out as: 'username' 'password</p>
  
  <p>what i'm trying to do is be able to edit the password and replace it with a new one using my code, but my code seems to do nothing and the text file just stays the same.</p>