title: How do I Escape a Double Quote in Velocity 2.0?
body: <p>I'm using Velocity 2.0.  I've created a method in a custom tool that finds and returns a substring between two strings.  This method takes three arguments: the initial string, a beginning subsequence, and an ending subsequence.  I've verified that this is working with unit tests.</p>
  
  <p>My question is this: how do, in my velocity template, escape quotes so that I can pass in a string that contains double quotes?</p>
  
  <p>My initial string <code>$mystr</code> is a json snippet and will look something like:</p>
  
  <pre><code>"receiver":"867-5309",
  </code></pre>
  
  <p>I'm trying to extract the <code>867-5309</code> from the string, which means that my begin string is <code>"receiver":"</code> and my end string is <code>",</code></p>
  
  <p>I've tried:</p>
  
  <pre><code>$stringTool.findSubstringBetween($mystr, """receiver"":"", """,")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$stringTool.findSubstringBetween($mystr, "\"receiver\":\", "\",")
  </code></pre>
  
  <p>but neither of these works (the first one causes a ParseErrorException, and the second yields double backslashes in the values passed to the method).</p>