I am creating a string array with values from a custom object, like this:
foreach(MyObject o in MyObjectList)
string[] myArray = new string[] {o.id, o.number.toString(), o.whatever, ...}
The problem here is, that any of those values can be NULL, which makes this code crash of course. Lets say o.number is NULL and the rest is not ... in this case I still want to fill the other values and put "NULL" as string instead of o.number.
Is there a nice way to do it, except checking each value?
Thanks :)
NullReferenceExceptionsince it's null, if strongly typed, it returns the empty string.