Tuesday 6 August 2013

Ternary Operator Simplification : Remove Repitition

Ternary Operator Simplification : Remove Repitition

pCuriously, is there a shorter way to write this in one line without
having to reference the node twice? I find myself doing a lot of these in
parsing. /p precodelidID.idCountry =
(passportnode.Descendants(COUNTRY).First().Value != String.Empty) ?
passportnode.Descendants(COUNTRY).First().Value : NONE /code/pre por is
the simplest way to make a temp variable for the value?/p

No comments:

Post a Comment