Print Page | Close Window

Breaking up a string

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=1501
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Breaking up a string
Posted By: vdub
Subject: Breaking up a string
Date Posted: 31 March 2003 at 3:02am

I have a problem that might be easy to solve. I have a string I need to break up into 3 values.

 

<option value="<%=poll_id%>,<%=topic_id%>,<%=forum_id%>"><%=Poll_question%></option>

 

This is a drop down box and when I process the results I need to break this string down to 3 values

 

1.)    poll_id

2.)    topic_id

3.)    forum_id

 

I have totally flaked on how to do this.

 



-------------
http://www.CyberCPU.net - Hardware reviews, Forum, Free advertising!!!!



Replies:
Posted By: Bunce
Date Posted: 31 March 2003 at 3:40am

As long as the delimter is constant (such as the comma), you can split them into an array:

Dim aValues    'as array
aValues = split(yourstring,",")



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: vdub
Date Posted: 31 March 2003 at 3:47am

yeah I got that far the part i am stuck on is spliting the values up.

poll_id = <%=poll_id%>

topic_id = <%=topic_id%>

forum_id = <%=foum_id%>

basicly what I am doing is adding a poll to my front page of my site using a list of polls from my forum. I am making a new page in the admin section to change these polls and want to just chose a poll to display from a drop down list. I have everything working but this string.



-------------
http://www.CyberCPU.net - Hardware reviews, Forum, Free advertising!!!!


Posted By: vdub
Date Posted: 31 March 2003 at 4:20am

I got it working

heres the code I used

pollarray = split(pollstring,",")
pollid = pollarray(0)
topic_id = pollarray(1)
forum_id = pollarray(2)


it works great.

Thanks for your help Bunce you got me on the right track



-------------
http://www.CyberCPU.net - Hardware reviews, Forum, Free advertising!!!!



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