Results 1 to 3 of 3

Thread: [RESOLVED] How can I merge 2 strings array into a new string array ?!!

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2011
    Posts
    8

    Resolved [RESOLVED] How can I merge 2 strings array into a new string array ?!!

    Hello ,


    I have 2 string arrays and I want to merge them together then put the elements into a third string array ..


    for an example :



    string1="a","b","c"
    string2="d","e","f"


    after merging:
    string3="a","b","c","d","e","f"


    Thanks for any help

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,416

    Re: How can I merge 2 strings array into a new string array ?!!

    try this:

    vb Code:
    1. Dim string1() As String = {"a", "b", "c"}
    2. Dim string2() As String = {"d", "e", "f"}
    3. Dim joinedList As New List(Of String)
    4. joinedList.AddRange(string1)
    5. joinedList.AddRange(string2)
    6. Dim string3() As String = joinedList.toarray

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2011
    Posts
    8

    Re: How can I merge 2 strings array into a new string array ?!!

    I tried this and it worked perfectly God bless you . .

    I wish for you a great day

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width