Quick C# Quiz
Will
this code throw an AgrumentNullException? and why?
string
firstName = null;
String.Format (“{0}”, firstName); prefix = o ns = "urn:schemas-microsoft-com:office:office"
/>
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);
sb.AppendFormat(provider,format,args);
return sb.ToString();
}