C# String.Format args

Viewed 79587

I have an array like this:

object[] args

and need to insert those args in a string, for example:

str = String.Format("Her name is {0} and she's {1} years old", args);

instead of:

str = String.Format("Her name is {0} and she's {1} years old", args[0], args[1]);

NOTE: Actually the first line of code worked! But args[1] was missing! Sorry and thank you. Points for every one :)

8 Answers
Related