using System.Collections.Generic;
public static void Main(string[] args)
var FinderObject = new FinderObject();
var PatientList = new List<string>();
var DoctorList = new List<string>();
PatientList.Add("Vijay");
PatientList.Add("SathyaVijay");
PatientList.Add("Sathya");
DoctorList.Add("Vijaykumar");
DoctorList.Add("Sathya");
var Patient = FinderObject.Find(PatientList, Name);
var Doctor = FinderObject.Find(DoctorList, Name);
public class FinderObject
public object Find(List<string> _List, string _Name)
var re = _List.Where(o => o.Contains(_Name));
re.ToList().ForEach(e => Console.WriteLine(e + Environment.NewLine));
public void Add(string name)