Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 12th, 2005, 05:48 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,942 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 340933 Folding Title: Super Ultimate Folder - Level 1Folding Points: 340933 Folding Title: Super Ultimate Folder - Level 1Folding Points: 340933 Folding Title: Super Ultimate Folder - Level 1Folding Points: 340933 Folding Title: Super Ultimate Folder - Level 1Folding Points: 340933 Folding Title: Super Ultimate Folder - Level 1Folding Points: 340933 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 12 h 47 m 26 sec
Reputation Power: 1537
Post String Manipulation - finding text between two delimeters (ASP)

Code:
  <% 
  Function GetBetween(str, leftDelimeter, rightDelimeter)
  	Dim tmpArr, result(), x
  	tmpArr=Split(str, leftDelimeter)
  	If UBound(tmpArr) < 1 Then
  		GetBetween=Array() : Exit Function
  	End If
  	ReDim result(UBound(tmpArr)-1)
  	For x=1 To UBound(tmpArr)
  		result(x-1)=(Split(tmpArr(x), rightDelimeter))(0)
  	Next
  	Erase tmpArr
  	GetBetween=result
  End Function
  
  'usage:
  Dim strHtml, arrValues, x
 strHtml="<table><tr><td>AAA</td><td>BBB</td><td>CCC</td></tr></table>"
  arrValues=GetBetween(strHtml, "<td>", "</td>")
  For x=0 To UBound(arrValues)
     Response.Write(arrValues(x)&"<br />")
  Next
  %>
  

the above function would return array of strings which are found between the given delimeters.

for comments, problems or questions please reply here.
Happy Programming!
Attached Files
File Type: txt GetBetween.asp.txt (607 Bytes, 239 views)

Last edited by Shadow Wizard : April 12th, 2005 at 05:53 AM.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > String Manipulation - finding text between two delimeters (ASP)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway