Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jbrave
Channel Surfer

array concatenation?

is there a way to concatenate arrays?

arrayone=["test","west","best"]

arraytwo=["guest","fest","blessed"]

arraythree= [arrayone+arraytwo]


this results in a two element array containing two arrays, instead of one array containing all six elements.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
3 REPLIES 3
hoffmcs
Visitor

Re: array concatenation?

This should work.
arrayone.Append(arraytwo)
0 Kudos
jbrave
Channel Surfer

Re: array concatenation?

seems to work. arraythree=arrayone.append(arraytwo) on the otherhand seems to result in type UNKNOWN
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

Re: array concatenation?

Append doesn't return a value, it appends the second array to the first. If you need a third array, you should do this:

arrayone = [ "blah", "blah", "blah" ]
arraytwo = [ "blah", "blah", "blah" ]
arraythree = []
arraythree.Append(arrayone)
arraythree.Append(arraytwo)
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.