Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 count items in a string, then take some of it away
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 26 October 2001 :  16:04:37  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
i have a string (fpoem) and after the 3rd <p> tag is found it ends the fpoem. Does anyone know how to do this? Basically this is a sample below...


fpoem = "There was a<p>dog in the<p>road and i almost<p>hit it. But a barely missed it<p>and hit a cat instead.<p>"

so after i run it thru the function, i would get...

fpoem = "There was a<p>dog in the<p>road and i almost"

If you dont udnerstand then i will try to explain more.

Brad

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 26 October 2001 :  16:19:06  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I'm not saying this will work, but you can try it...


strPos1 = InStr(fPoem, "<p>")
strPos2 = InStr(strPos1, fPoem, "<p>")
strPos3 = InStr(strPos2, fPoem, "<p>")

fPoem = Left(fPoem, strPos3)


---------------
Da_Stimulator has spoken
Ongoing Project that uses Snitz forums as a backbone for entire website
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 26 October 2001 :  16:26:13  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I still dont know the above script works, but *assuming* it does, if you want to save the rest of the string, try using the one below...


strLength = Len(fPoem)

'Count the <p>'s
strPos1 = InStr(fPoem, "<p>")
strPos2 = InStr(strPos1, fPoem, "<p>")
strPos3 = InStr(strPos2, fPoem, "<p>")
'Make sure you can save the rest of the string
strLength1 = strLength - strPos3
fPoem1 = Right(fPoem, strLength1)
'Get string until 3rd <p>
fPoem = Left(fPoem, strPos3)


---------------
Da_Stimulator has spoken
Ongoing Project that uses Snitz forums as a backbone for entire website
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07