string[] arrTopics = {\"Health\", \"Science\", \"Politics\"};
I have an if statement like:
if (arrTopics.Count() != null)
<
Like the error says, int
can never be null. I'd change the code to
if (arrTopics != null && arrTopics.Any())
Or even more efficient if you know arrTopics is an array and never null is
arrTopics.Length != 0
What are you trying to ask here?
Array.Count() returns an int which will never be null.
If you want to know if the Array has been initialised then:
if(arrTopics !=null) ...
if you want to know if it's been initialised but has no members then:
if(arrTopics.Count() > 0) ...
Null is a special pointer value, and not an integer. There are nullable types, that are either null or one of the possible values for the base type, but int itself is not nullable.