Split a string

this takes our string and splits the string into substrings using the comma ( , ) as our delimiter . This is then stored in an array . We then loop through all the elements of the array from 0 to the UBound of the array and display all of the substrings separately.

Code :

<%
Dim strText , arrText , intCount
'sample string with commas in it
strText = "This,is,our,sample,string"
'split the string and store in arrText
arrText = Split(strText,",")
'display all items
For intCount = 0 to UBound(arrText)
Response.Write arrText(intCount) & "<br>"
Next
%>

 

 

Sponsors