I just realized that you can do: public static class Extensions { public static bool IsNullOrWhiteSpace(this string? str) => string.IsNullOrWhiteSpace(str); } And then you can just do: if (name.IsNullOrWhiteSpace()) ... Instad of: if (string.IsNullOrWhiteSpace(name)) ... Actually, while writing this i'm realising that now with the extensions keyword you can even implement it as a read-only property. What are some other life hacks that can make us happier people? submitted by /u/Alert-Neck7679 [link] [comments]