asp. = = net about? : and if of else of conditional judgment equivalent examples

  • 2020-05-09 18:24:37
  • OfStack

I was instructed by the master yesterday
The test used
= =? : and if else () ()
xzyHe is the value of DropDownlist, which is 0 if it is empty
 
if (xzyHe ==""){int xzyHe==0;else{int xzyHe = DropDownlist.Text.Trim();} 

Another writing method:
 
int xzyHe = ConVert.ToInt32(xzyHe == ""?0:int.Parse(DropDownlist.Text.Trim())); 

Related articles: