Answers for "how to find or search in array C#"

C#
0

c# search string array

string [] arr = {"One","Two","Three"};
       var target = "One";
       var results = Array.FindAll(arr, s => s.Equals(target));
Posted by: Guest on August-07-2020
0

find items in array c#

string[] names = { "Steve", "Bill", "Bill Gates", "Ravi", "Mohan", "Salman", "Boski" };
var stringToFind = "Bill";
 
var result = Array.Find(names, element => element == stringToFind); // returns "Bill"
Posted by: Guest on May-16-2021

Code answers related to "how to find or search in array C#"

C# Answers by Framework

Browse Popular Code Answers by Language