Advertisement
elena1234

How to merge two arrays

Dec 4th, 2021
1,321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. using System.Linq;
  2.  
  3. namespace ConcatTwoArrays
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int[] front = { 1, 2, 3, 4 };
  10.             int[] back = { 5, 6, 7, 8 };
  11.             int[] combined = front.Concat(back).ToArray();
  12.         }
  13.     }
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement