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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nagmvs
    New Member
    • Aug 2008
    • 49

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

    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
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    sure .

    Comment

    • Krandor
      New Member
      • Aug 2008
      • 50

      #3
      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)
      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.
      Last edited by jhardman; Aug 30 '08, 05:52 AM. Reason: corrected code tags - please use square brackets

      Comment

      • nagmvs
        New Member
        • Aug 2008
        • 49

        #4
        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 .

        Comment

        • nagmvs
          New Member
          • Aug 2008
          • 49

          #5
          Originally posted by jhardman

          Thanku

          Thanku very much.

          Comment

          • nagmvs
            New Member
            • Aug 2008
            • 49

            #6
            Originally posted by jhardman
            Thanks sirrrrrrrrrrrrr rrrrrrrrrrrrrrr

            Comment

            Working...