title: F# - Save the previous printed text
body: <p>So I have a text file containing characters where I let the user read by printing in the console (by reading the file content into a char list and converting it to a string), after that I am trying to let the user change one letter in the char list. However doing so I will have to do a loop and access the variable containing the char list and loop through it and later save it in the same variable (or a new variable) to show the user for approval, if not the user should be able to change a character again by running the same loop.</p>
  
  <p>Though my problem is that I can't find a way to change the variable containing the character list without making the variable mutable. Is there any suggestion for this problem?</p>
  
  <pre><code>            while true do            
                  Console.Write("\n\nDo you want to change some tokens? press 1 or 2 to end: ")
                  let rep = Console.ReadLine() |&gt; int
                  if rep = 1 then
                      Console.Write("\n\n Enter the token you will change in the text : ")
                      let user = Console.ReadLine() |&gt; char
                      let k1 = user
                      Console.Write("\n Enter your token you will replace TO : ")
                      let user2 = Console.ReadLine() |&gt; char
                      let k2 = user2
                      let t = finalList
                      let finalList2 = swap t k1 k2
                      let f2 = finalList2 |&gt; charListToString
  
                      printfn "%s" f2
  </code></pre>
  
  <p>As seen in my code implementation above, I can only change the list once and if the loop runs again it will loose the first value which was changed before.</p>