using System.Collections.Generic;
public string GroupName {get {return this.groupName;}}
public void EditGroup(string groupName)
this.groupName = groupName;
public Group(string groupName)
this.Students = new List<Student>();
this.groupName = groupName;
Students = new List<Student>();
this.Students.Add(new Student("Vasya","Pupkin"));
this.Students.Add(new Student("Kolya","Pupko"));
this.Students.Add(new Student("Ira","Supkova"));
public List<Student> this[string lastName]
List<Student> tempList = new List<Student>();
string format = lastName.Substring(0,1).ToUpper() + lastName.Substring(1).ToLower();
for(int i = 0; i < this.Students.Count; i++)
if(this.Students[i].LastName.Contains(format))
tempList.Add(Students[i]);
public string LastName {get {return this.lastName;}}
public Student(string firstName, string lastName)
this.firstName = firstName;
this.lastName = lastName;
public override string ToString()
return string.Format("{0} {1}",this.firstName,this.lastName);
public static void Main()
Group gr = new Group("Net 14-2");
foreach(Student a in gr["pupk"])
Console.WriteLine(a.ToString());