Print Page | Close Window

searching through long strings HELP

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1436
Printed Date: 28 March 2026 at 11:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: searching through long strings HELP
Posted By: joshyjosh
Subject: searching through long strings HELP
Date Posted: 28 March 2003 at 9:25pm
I am trying to stop users from adding in long obnoxious strings like qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq so I need some help, how would I search through a tring and check the length and then if too long cut it short? would I throw them all into an array and the and search each word?



Replies:
Posted By: joshyjosh
Date Posted: 28 March 2003 at 10:02pm

nevermind I ended up figuring it out, this works for me. I ended up getting help from borg, well one of his functions in the forum v7 anyways. Thanks borg     

Dim strDesc
Dim saryDesc
Dim strFinalDesc
Dim intCount

saryDesc = Split(strDesc)
For intCount = 0 To UBound(saryDesc)
   If Len(saryDesc(intCount)) > 40 Then
      strFinalDesc = strFinalDesc & Left(saryDesc(intCount),40) & " "
   Else
      strFinalDesc = strFinalDesc & saryDesc(intCount) & " "
   End If
Next
Response.Write(strFinalDesc)




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