Answers for "string empty or whitespace c#"

C#
2

remove whitespace between string c#

string str = "C Sharp";
str = Regex.Replace(str, @"s", "");
Posted by: Guest on September-17-2020
0

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
}
Posted by: Guest on October-19-2020

Code answers related to "string empty or whitespace c#"

C# Answers by Framework

Browse Popular Code Answers by Language