From bba3143d28e4eb618772f3b87426893d8d1f2bed Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:05:21 +0200 Subject: [PATCH] feat: add IsNullOrEmpty, IsNullOrWhitespace to StringExtensions.cs --- Dalamud/Utility/StringExtensions.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dalamud/Utility/StringExtensions.cs b/Dalamud/Utility/StringExtensions.cs index d5c1dfc14..f452a2a0f 100644 --- a/Dalamud/Utility/StringExtensions.cs +++ b/Dalamud/Utility/StringExtensions.cs @@ -12,5 +12,19 @@ namespace Dalamud.Utility /// Format arguments. /// Formatted string. public static string Format(this string format, params object[] args) => string.Format(format, args); + + /// + /// Indicates whether the specified string is null or an empty string (""). + /// + /// The string to test. + /// true if the value parameter is null or an empty string (""); otherwise, false. + public static bool IsNullOrEmpty(this string value) => string.IsNullOrEmpty(value); + + /// + /// Indicates whether a specified string is null, empty, or consists only of white-space characters. + /// + /// The string to test. + /// true if the value parameter is null or an empty string (""), or if value consists exclusively of white-space characters. + public static bool IsNullOrWhitespace(this string value) => string.IsNullOrWhiteSpace(value); } }