18 lines
428 B
C#
18 lines
428 B
C#
using System.Diagnostics.Contracts;
|
|
|
|
namespace bts.utils {
|
|
static class StringExtensions {
|
|
[Pure]
|
|
public static string EmptyIfNull(this string str) =>
|
|
str ?? "";
|
|
|
|
[Pure]
|
|
public static string NullIfEmpty(this string str) =>
|
|
str == "" ? null : str;
|
|
|
|
[Pure]
|
|
public static bool IsNullOrEmpty(this string str) =>
|
|
string.IsNullOrEmpty(str);
|
|
}
|
|
}
|