© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
magikusgierus

Joining arrays

Hi, I'm using Unity but I don't think it's important.
I have a list of object, on which I want to call a method which returns a regular array (struct[]) which can be quite big.
Then I want to join all those arrays into a singular array. That big array will be generated only once, not modified and used for grabbing a random entry from that array multiple times.
As I'm not that experienced in optimizing c#:
1. Is there any advantage in using array here instead of List<T> which I feel is easier to work with?
2. What's the best way to join those arrays into singular one?

So far I'm doing it like that, but I think it is not optimal as I create new array for each iteration?
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ arrays
C#CC# / help
3mo ago
Arrays
C#CC# / help
4y ago
✅ Creating arrays
C#CC# / help
9mo ago
✅ arrays addition
C#CC# / help
2y ago