Use ArgumentException.ThrowIfNullOrWhiteSpace()
ProprietaryReplace if (string.IsNullOrWhiteSpace(s)) throw new ArgumentException("...", nameof(s)) guard clauses with ArgumentException.ThrowIfNullOrWhiteSpace(s). Available since .NET 8.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net8. UseThrowIfNullOrWhiteSpacemod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net8. UseThrowIfNullOrWhiteSpaceInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.