Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

best practice c# check if string is null or whitespace

if(string.IsNullOrWhiteSpace(stringToCheck) == true){
  //do thing if empty, whitespace, or null
}else{
  //do thing if contains value
}
 
PREVIOUS NEXT
Tagged: #practice #check #string #null #whitespace
ADD COMMENT
Topic
Name
9+7 =