Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# sort array of objects


public class People
{
	public string FirstName;
  	public String LastName;
  
  	public Person(string firstName,string lastName)
    {
    	FirstName = firstName;
      	LastName = lastName;
    }
  
  public static void Main(string args[])
  {
  	Person[] people = {
    new Person(){ FirstName="Steve", LastName="Jobs"},
    new Person(){ FirstName="Bill", LastName="Gates"},
    new Person(){ FirstName="Lary", LastName="Page"}
};
 
Array.Sort(people);
    
  }
	
}

 
PREVIOUS NEXT
Tagged: #sort #array #objects
ADD COMMENT
Topic
Name
3+1 =