title: How to replace escaped symbol with its actual value?
body: <p>I have a string like <code>escape new lines\n</code>. When printing it, it doesn't replace <code>\n</code> with a new line, it just prints <code>escape new lines\n</code>. I'm iterating over this <code>std::string</code>, and I want to replace <code>\n</code> with it's actual value:</p>
  <pre class="lang-cpp prettyprint-override"><code>bool seenSlash = false;
  for (int index = 0; index &lt; text.length(); ++index) {
      if (text[index] == '\\') {
          seenSlash = true;
          continue;
      }
      if (seenSlash) {
          // what to do here?
          seenSlash = false;
      }
  }
  </code></pre>
  <p>It's not just <code>\n</code>, I want to support all of those escaping symbols. How can I do it?</p>