How to find the first element in string array that equal to specific length in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
   
        string[] arr = { "c#", "java", "python", "swift", "php", "ada" };

        var result = Array.Find(arr, element => element.Length == 3);

        Console.Write(result);
    }
}



/*
run:

php

*/

 



answered Nov 2, 2020 by avibootz
...