If you do not know how many array elements are in the arguments array, try using string.Join().
string.Format("Arguments passed in to the program are: {0}", string.Join(" ", args));
Specifically in your example:
string.Format("Her name is {0} years old", string.Join(" and she's ", args));
Personally, I don't like hard-coded structures of an array object. That's too much to remember throughout the application and makes it hard to maintain. I would rather turn the arguments into a "Person" object with a constructor that accepts the array, and overload the ToString() to display the specific information about the object members.
class Person
{
private string m_sName;
private string m_sAge;
public Person(string[] args)
{
m_sName = args[0];
m_sAge = args[1];
}
public override string ToString()
{
return string.Format("Her name is {0} and she's {1} years old.", m_sName, m_sAge);
}
}
So you can construct a "Person" object and display the message when called.
var oNewPerson = new Person(args);
console.WriteLine(oNewPerson.ToString());
This is very similar to a Microsoft example:
http://msdn.microsoft.com/en-us/library/ms173154(v=vs.80).aspx