title: How can I swap some values in a string variable and write it back with new values using Free Pascal?
body: <p>Having read a line from a text file using ReadLn(InputFile, strVar), I need to read each character of strVar, and if it contains the letter 'E' (for example), I want to output (write to a new file, in fact) the original variable but with the 'E' being swapped\replaced with the numeric digit '3'.</p>
  
  <p>So, if 'Example' is read from the file, I want '3xample' to be written to a new file.</p>
  
  <p>How do I code the swapping in Free Pascal (I can do the writing to the file bit)? Other languages seem to have a swap function or something.</p>
  
  <p>Thanks</p>
  
  <p>Ted</p>