title: Creating Excerpt text with a read more link
body: <p>I have a varchar field full of text and I want to be able to just show a 100 character snippet of the text, and show a "Read More..." link at the end of the snippet. When the user clicks "Read More..." I would like the page to expand and display the rest of the text.</p>
  
  <p>I guess the 'show/hide' featured could be done with jQuery but i wasn't sure if ASP had some function to effectively split the varchar field of text in two?</p>
  
  <p>My content is currently being pulled into the page using;</p>
  
  <pre><code>&lt;%=StripHTML(rspropertyresults.Fields.Item("ContentDetails").Value)%&gt;
  </code></pre>
  
  <p>Which uses this function to strip out any HTML tags;</p>
  
  <pre><code>&lt;%
  Function stripHTML(strHTML)
    ''Strips the HTML tags from strHTML
  
    Dim objRegExp, strOutput
    Set objRegExp = New Regexp
  
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    objRegExp.Pattern = "&lt;(.|\n)+?&gt;"
  
    ''Replace all HTML tag matches with the empty string
    strOutput = objRegExp.Replace(strHTML, "")
  
    ''Replace all &lt; and &gt; with &amp;lt; and &amp;gt;
    strOutput = Replace(strOutput, "&lt;", "&amp;lt;")
    strOutput = Replace(strOutput, "&gt;", "&amp;gt;")
  
    stripHTML = strOutput    ''Return the value of strOutput
  
    Set objRegExp = Nothing
  End Function
  %&gt;
  </code></pre>