src/packages/EmbedIO/Utilities/Validate.cs
/// <summary>
/// Ensures that a <see langword="string"/> argument is neither <see langword="null"/> nor the empty string.
/// </summary>
/// <param name="argumentName">The name of the argument to validate.</param>
/// <param name="value">The value to validate.</param>
/// <returns><paramref name="value"/> if neither <see langword="null"/> nor the empty string.</returns>
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException"><paramref name="value"/> is the empty string.</exception>
Ensures that a  argument is neither  nor the empty string.
Ensures that a argument is neither nor the empty string .
public static string NotNullOrEmpty(string argumentName, [ValidatedNotNull] string? value)
        {
            if (value == null)
                throw new ArgumentNullException(argumentName);
            if (value.Length == 0)
                throw new ArgumentException("String is empty.", argumentName);
            return value;
        }
public static string NotNullOrEmpty ( string argumentName , [ ValidatedNotNull ] string ? value ) { if ( value == null ) throw new ArgumentNullException ( argumentName ) ; if ( value . Length == 0 ) throw new ArgumentException ( " " , argumentName ) ; return value ; }
Ensures that a  argument is neither  nor the empty string.
Ensures that a argument is neither nor the empty string .
if neither  nor the empty string.
if neither nor the empty string .
None
None
argumentName
string
The name of the argument to validate.
The name of the argument to validate .
string?
[ValidatedNotNull]
value
The value to validate.
The value to validate .