Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

set zero if null or empty in c#

Suppose text = null 
OR
suppose text = ""
String.IsNullOrEmpty(text) ? 0 : int.Parse(text); // it will return zero
use the about line to get the desire value to want in place of null or empty
 
PREVIOUS NEXT
Tagged: #set #null #empty
ADD COMMENT
Topic
Name
6+2 =