diff --git a/X10D/src/StringExtensions/StringExtensions.cs b/X10D/src/StringExtensions/StringExtensions.cs index 7209ae0..c35f2ce 100644 --- a/X10D/src/StringExtensions/StringExtensions.cs +++ b/X10D/src/StringExtensions/StringExtensions.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using System.Text; namespace X10D; @@ -8,27 +9,29 @@ namespace X10D; public static class StringExtensions { /// - /// Returns the current string, or if the current string is null or empty. + /// Normalizes a string which may be either or empty to . /// - /// The value to sanitize. + /// The value to normalize. /// - /// if is or equal to - /// , or otherwise. + /// if is or empty; otherwise, + /// . /// + [return: NotNullIfNotNull("value")] public static string? AsNullIfEmpty(this string? value) { return string.IsNullOrEmpty(value) ? null : value; } /// - /// Returns the current string, or if the current string is null, empty, or consists of only - /// whitespace. + /// Normalizes a string which may be either , empty, or consisting of only whitespace, to + /// . /// - /// The value to sanitize. + /// The value to normalize. /// - /// if is or equal to - /// or is composed of only whitespace characters, or otherwise. + /// if is , empty, or consists of only + /// whitespace; otherwise, . /// + [return: NotNullIfNotNull("value")] public static string? AsNullIfWhiteSpace(this string? value) { return string.IsNullOrWhiteSpace(value) ? null : value;