PDA

Click to See Complete Forum and Search --> : array elements to string without looping


Jan 19th, 2000, 01:15 AM
'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

Jan 19th, 2000, 01:36 AM
there sure is a faster way...


mystring = Join(MyArray, "") 'there is no space between the quotes

thats it!

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

Wossname,
Email me: wossnamex@talk21.com :)

Jan 19th, 2000, 01:44 AM
thank you wossame !