Identify characters that have being escaped
<p>I am trying to figure out whether a string that contains single or double quotes also contained a backslash character to escape it or not</p>
<p>I noticed that on c#, if I have the following two strings</p>
<pre><code>string escaped = &quot;It\'s awesome. \&quot;Yes it is\&quot; &quot;;
string nonEscaped = &quot;It's awesome. Yes it is&quot;;
</code></pre>
<p>then they get printed out in the exact same way (except for the double quotes):</p>
<blockquote>
<p>It's awesome. Yes it is</p>
<p>It's awesome. &quot;Yes it is&quot;</p>
</blockquote>
<p>Which makes sense because the escaped characters don't get printed out...</p>
<p>However, I am trying to write a function to identify that It's and &quot;Yes it is&quot; are using escaped characters for the single and double quotes...</p>
<p>Is there a way to do that?</p>