Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FirstExample
- {
- class Program
- {
- static void Main()
- {
- string[] people = new string[3] { "Don", "Steve", "Michael" };
- Console.WriteLine(FoundPerson(people));
- }
- static string FoundPerson(string[] people)
- {
- for (int i = 0; i < people.Length; i++)
- {
- if (people[i].Equals("Don"))
- {
- return "Don";
- }
- if (people[i].Equals("John"))
- {
- return "John";
- }
- if (people[i].Equals("Kent"))
- {
- return "Kent";
- }
- }
- return String.Empty;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement