📜  string isnullorempty vs isnullorwhitespace - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:09.329000             🧑  作者: Mango

代码示例1
/* IsNullOrWhiteSpace is a convenience method that is similar to 
the following code, except that it offers superior performance: */

return String.IsNullOrEmpty(value) || value.Trim().Length == 0;

/* White-space characters are defined by the Unicode standard. 
The IsNullOrWhiteSpace method interprets any character that returns
a value of true when it is passed to the Char.IsWhiteSpace method as
a white-space character. */