Solved

vb.net web page Loop through comma seperated string

Posted on 2016-08-31
3
34 Views
Last Modified: 2016-09-04
I have a comma separated string I would like to loop through

resetstring

For each item in string
 Response.Write(item)
Next
0
Comment
Question by:lrbrister
3 Comments
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 250 total points
ID: 41778880
Something like ...
Dim myLongString as String = "value1,value2,value3"
DIm myValues() as String = myLongString.Split(CChar(","))
For Each s as String in myValues
 ' s contains the individual comma-separated values.

Next

Open in new window

0
 
LVL 63

Assisted Solution

by:Fernando Soto
Fernando Soto earned 250 total points
ID: 41778889
Hi;

What is your question? By the way your code shown below iterates through the string one character at a time. So item is a single character from the string each time through the loop.

For each item in string
 Response.Write(item)
Next
0
 

Author Closing Comment

by:lrbrister
ID: 41783956
Thanks guys!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question