title: Automatically escaping characters within strings
body: <p>I am working on a C# project where I am exporting data from a database that is defined by the user so I have no idea what the data is going to contain or the format it is going to be in. </p>
  
  <p>Some of the strings within the database might include apostrophe's (') which I need to escape but everything I've found on the internet shows that I would have to do string.replace("'", "\'"); which seems a bit odd as it would be a mass of replace statements for every possibility. </p>
  
  <p>Isn't there a better way to do this. </p>
  
  <p>Thanks for any help you can provide. </p>