locked
split a concatinated string in vb.net RRS feed

  • Question

  • User1451151890 posted

    split a concatinated string in to 2 string Eg:concatinated string -:Airlines | 2

    i want like this

    Dim s1 as string="Airlines"

    Dim s1 as string="2"

     

    Sunday, July 13, 2008 1:14 AM

Answers

  • User1191518856 posted
    Dim conc As String = "Airlines | 2"
    Dim s As String() = conc.Split(" | ")
    Dim s1 As String = s(0)
    Dim s2 As String = s(1)
    When you perform a Split, it will return a string array for you containing the segments of the (concatenated) string
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 13, 2008 1:48 AM

All replies

  • User1191518856 posted
    Dim conc As String = "Airlines | 2"
    Dim s As String() = conc.Split(" | ")
    Dim s1 As String = s(0)
    Dim s2 As String = s(1)
    When you perform a Split, it will return a string array for you containing the segments of the (concatenated) string
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 13, 2008 1:48 AM
  • User1451151890 posted

    Thank u

    Sunday, July 13, 2008 3:16 AM