由于某种原因,unknown visualstudio
告诉我这段代码无法访问:
int? newInt = null; string test = newInt.ToString(); if (test == null) { //unreachable Code }
谢谢您的帮助!:)
string test = newInt.ToString();
如果将其转换为,test将永远不会为null string
.转换它时,它将变为空字符串.
int? newInt = null; string test = newInt.ToString(); if (test == "") { Console.WriteLine("Hello World"); //Reaches the code }