title: Javascript: How do I replace text between two delimiters?
body: <pre><code>var record = "HENRY|5|58|L581"
  </code></pre>
  
  <p>How do I change the above to:</p>
  
  <pre><code>record now equals "HENRY|Five|58|L581"
  </code></pre>
  
  <p>I know how to retrieve the index of the first '|' and the second '|'  .. I know how to retrieve the number '5' into a string. </p>
  
  <p>But I have no idea how to actually replace that 5 with the word Five.</p>
  
  <p>The part |5| could be any number from 1-50</p>