/// <summary> /// Returns a logical value indicating if the string value is empty. /// If allowEmptyValue = true, empty means an empty string /// If allowEmptyValue = false, empty means an empty or null string /// </summary> /// <param name="value">String value</param> /// <param name="allowEmptyValue">Specifies if an empty string is allowed</param> /// <returns>True if empty, otherwise false</returns> public static bool IsEmpty(string value, bool allowEmptyValue) { if (allowEmptyValue) { return value == null; } else { return String.IsNullOrEmpty(value); } }>