Connecting Tech Pros Worldwide Forums | Help | Site Map

Can anyone tell me about the usage of split function in Asp with Example ?

Member
 
Join Date: Aug 2008
Posts: 42
#1: Aug 29 '08
Can anyone tell me about the usage of split function in Asp with Example ?

i done one project using split function.and i have some problems regarding storing data in data base.I use there variables.the data in the two variables is stored correctly.But the third variable data is stored some where. So please tell me some different tech. oh using split function in ASP using VB.NET.

thanks,

jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#2: Aug 29 '08

re: Can anyone tell me about the usage of split function in Asp with Example ?


sure .
Member
 
Join Date: Aug 2008
Posts: 49
#3: Aug 29 '08

re: Can anyone tell me about the usage of split function in Asp with Example ?


Expand|Select|Wrap|Line Numbers
  1. Dim v_Results
  2. Dim s_Text
  3.  
  4.     s_Text = "Apples;Oranges;Pears;Bananas"
  5.     v_Results = Split(s_Text, ";", , vbTextCompare)
  6.    Response.write  v_Results(0) & "<BR>" & v_Results(1) & "<BR>" & v_Results(3)
  7.  
In this case it is splitting on the semi colon(;). Everything to the left of the delimiter (the semi colon) is put into one element of the array (v_Result).

It is importnat to note that the array is zero based. Meaning that the first element is zero and not 1 as most people would suppose.
Member
 
Join Date: Aug 2008
Posts: 42
#4: Aug 30 '08

re: Can anyone tell me about the usage of split function in Asp with Example ?


Quote:

Originally Posted by Krandor

<code>
Dim v_Results
Dim s_Text

s_Text = "Apples;Oranges;Pears;Bananas"
v_Results = Split(s_Text, ";", , vbTextCompare)
Response.write v_Results(0) & "<BR>" & v_Results(1) & "<BR>" & v_Results(3)
</code>
In this case it is splitting on the semi colon(;). Everything to the left of the delimiter (the semi colon) is put into one element of the array (v_Result).

It is importnat to note that the array is zero based. Meaning that the first element is zero and not 1 as most people would suppose.



Thanku sir, Thanku very much.This code is very useful to understand the Split concept.Thanku .
Member
 
Join Date: Aug 2008
Posts: 42
#5: Aug 30 '08

re: Can anyone tell me about the usage of split function in Asp with Example ?


Quote:

Originally Posted by jhardman

sure .


Thanku

Thanku very much.
Member
 
Join Date: Aug 2008
Posts: 42
#6: Sep 2 '08

re: Can anyone tell me about the usage of split function in Asp with Example ?


Quote:

Originally Posted by jhardman

sure .

Thanks sirrrrrrrrrrrrrrrrrrrrrrrrrrrr
Reply