Results 1 to 3 of 3

Thread: array elements to string without looping

  1. #1
    Guest

    Post

    'Let's say we got:

    Dim MyArray(3) as String
    MyArray(0) = "A"
    MyArray(1) = "B"
    MyArray(2) = "C"
    MyArray(3) = "D"

    'And we want to have One string "ABCD"

    'this looks slow and clock cycles hungry

    For i = 0 to ubound(MyArray)
    MyString = MyString & MyArray(i)
    next i

    Is there a faster method ?

    thank you

  2. #2
    Guest

    Post

    there sure is a faster way...

    Code:
    mystring = Join(MyArray, "") 'there is no space between the quotes
    thats it!

    ------------------

    Wossname,
    Email me: [email protected]

  3. #3
    Guest

    Post

    thank you wossame !

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