Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Very succinct and perfect for my use-case! However, OP did state that "speed is important", and this approach does cause copying - so probably not the best in terms of performance, for which the accepted answer likely wins. Commented Apr 28, 2020 at 15:23
  • 1
    Indeed, I was just sad that with a question titled "Prepend to a C# Array" no one mentioned Prepend yet. Commented Apr 28, 2020 at 16:30
  • I like this answer, but would recommend making it more explicit as to what's going on as with types, in place vs a new copy, and return values. Commented Nov 6, 2023 at 17:23