feat: add IsNullOrEmpty, IsNullOrWhitespace to StringExtensions.cs

This commit is contained in:
goat 2021-08-10 14:05:21 +02:00
parent 9199adb261
commit bba3143d28
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -12,5 +12,19 @@ namespace Dalamud.Utility
/// <param name="args">Format arguments.</param>
/// <returns>Formatted string.</returns>
public static string Format(this string format, params object[] args) => string.Format(format, args);
/// <summary>
/// Indicates whether the specified string is null or an empty string ("").
/// </summary>
/// <param name="value">The string to test.</param>
/// <returns>true if the value parameter is null or an empty string (""); otherwise, false.</returns>
public static bool IsNullOrEmpty(this string value) => string.IsNullOrEmpty(value);
/// <summary>
/// Indicates whether a specified string is null, empty, or consists only of white-space characters.
/// </summary>
/// <param name="value">The string to test.</param>
/// <returns>true if the value parameter is null or an empty string (""), or if value consists exclusively of white-space characters.</returns>
public static bool IsNullOrWhitespace(this string value) => string.IsNullOrWhiteSpace(value);
}
}