Is use of string.IsNullOrEmpty(string)
when checking a string considered as bad practice when there is string.IsNullOrWhiteSpace(string)
in .NET 4.0 and above?
C# – string.IsNullOrEmpty vs string.IsNullOrWhiteSpace
.netc++string
.netc++string
Is use of string.IsNullOrEmpty(string)
when checking a string considered as bad practice when there is string.IsNullOrWhiteSpace(string)
in .NET 4.0 and above?
Best Answer
The best practice is selecting the most appropriate one.
Reference : Here
Reference : Here
Check the source code (Reference Source .NET Framework 4.6.2)
IsNullorEmpty
IsNullOrWhiteSpace
Examples