Print Page | Close Window

stripcode options.

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3340
Printed Date: 01 April 2026 at 12:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: stripcode options.
Posted By: Badaboem
Subject: stripcode options.
Date Posted: 07 June 2003 at 2:38am

Is it possible to adjust the stripcode function so it only displays the first image and say the first three hyperlinks in a forum post?

This would come in handy creating modified versions of the news mod (in order to create tutotials sections etc).

 

Function StripCode(strInput)
  'This function will remove any HTML in the given string
  strStripped = strInput

  intStart = InStr(1, strStripped, "<")
  Do While intStart <> 0
    intEnd = InStr(intStart, strStripped, ">")
    strStripped = Left(strStripped, intStart - 1) & Mid(strStripped, intEnd + 1)
    intStart = InStr(intStart + 1, strStripped, "<")
  Loop

  StripCode = strStripped
End Function




Replies:
Posted By: kiekeboe
Date Posted: 07 June 2003 at 7:16am

Regular expressions do a good job:

Function stripHTML(strHTML)

  Dim objRegExp, strOutput
  Set objRegExp = New Regexp

  objRegExp.IgnoreCase = True
  objRegExp.Global = True
  objRegExp.Pattern = "<(.|\n)+?>"
  strHTML = objRegExp.Replace(strHTML, "")

  objRegExp.Pattern = "&lt;.&gt;|&lt;..&gt;"
  strOutput = objRegExp.Replace(strHTML, "")

  stripHTML = strOutput    'Return value of strOutput

  Set objRegExp = Nothing 

End Function

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net