Blog

Curt Gratz

July 21, 2010

Spread the word


Share your thoughts

Have you ever wanted a quick and easy way to combine arrays in ColdFusion.  I have done this a number of ways in the best, but came across this gem and thought I would share.

All ColdFusion arrays are of the Java vector type, we can use the underlying java.util.Vector class methods, specifically the addAll() method.

Keep in mind that this is not a "documented" use of arrays in ColdFusion, so at any version it may stop working.

Merging two arrays in ColdFusion with the java.util.vector.addAll()

ar1 = ["a","b","c"]; ar2 = ["d","e","f"]; ar1.addAll(ar2); writeDump(ar1);

 

Add Your Comment

(1)

Dec 10, 2010 10:43:30 UTC

by Adam lewis

Thanks for the coding nugget. That pretty slick.

Recent Entries

BoxLang AI: The Foundation for Real-World AI Systems!

BoxLang AI: The Foundation for Real-World AI Systems!

BoxLang AI: From AI Experiments to Real-World Systems!

Why we built BoxLang AI?

AI is everywhere. New models, new tools, new announcements every week. But for most teams, the real challenge isn’t choosing ...

Victor Campos
Victor Campos
January 30, 2026
Speaker Featuring - Round 1

Speaker Featuring - Round 1

Every conference is more than the talks we see on stage it’s also the story of the people who make it possible.

With the first round of Into the Box 2026 sessions and workshops now live, we’re excited to introduce some of the speakers who will be joining us this year. These community members, practitioners, and Ortus team experts bring decades of real-world experience across CFML, BoxLang, JVM modernization, testing, AI, and cloud-native development.

Victor Campos
Victor Campos
January 26, 2026
First Round of the Into the Box 2026 Agenda Is Live

First Round of the Into the Box 2026 Agenda Is Live

Into the Box 2026 marks an important moment for the CFML and BoxLang community not just because of what’s on the agenda, but because of what it represents: 20 years of Ortus Solutions helping teams move forward, modernize, and build with confidence.

Victor Campos
Victor Campos
January 21, 2026