Will this code throw an AgrumentNullException? and why?


string firstName = null;
String.Format (“{0}”, firstName); 


Here is the for code String.Format , if that helps…


public static String Format(String format, Object arg0) {

            return Format(null, format, new Object[] {arg0});



public static String Format( IFormatProvider provider, String format, params Object[] args) {

            if (format == null || args == null)

                throw new ArgumentNullException((format==null)?"format":"args");

            StringBuilder sb = new StringBuilder(format.Length + args.Length * 8);


            return sb.ToString();