Array SequenceEqual

In this chapter you will learn:

  1. How to compare two arrays with Array SequenceEqual method

Use Array SequenceEqual method

using System;/*from  ja v  a2 s  .c o m*/
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;


public class MainClass{

   public static void Main(string[] args){   
         String[] Array1 = { "Zero", "One", "Two", "Three"};
         String[] Array2 = { "Zero", "One", "Two", "Three" };

         var ThisQuery = Array1.SequenceEqual(Array2);

         Console.WriteLine("Array1 = Array2: " + ThisQuery.ToString());

   }
}

Next chapter...

What you will learn in the next chapter:

  1. How to create custom types
Home » C# Tutorial » Array
Array
Array loop
Array dimension
Jagged Array
Array length
Array Index
Array rank
Array foreach loop
Array ForEach Action
Array lowerbound and upperbound
Array Sort
Array search with IndexOf methods
Array binary search
Array copy
Array clone
Array reverse
Array ConvertAll action
Array Find
Array SequenceEqual