Contains

CSharp · Console

/Program.cs

using System;
using System.Linq;

public class Program
{
	public static void Main()
	{
		// Example array of colors
		var colors = new[] { "red", "blue", "green", "yellow", "purple", "orange" };

		// Check if array contains 'blue'
		bool result = colors.Contains("blue");

		Console.WriteLine(result);

		// output: True
	}
}
;