src/packages/EmbedIO/Utilities/NameValueCollectionExtensions.cs
/// <summary>
/// Determines whether a <see cref="NameValueCollection"/> contains one or more values
/// for the specified <paramref name="name"/>, at least one of which is equal to the specified
/// <paramref name="value"/>. Value comparisons are carried out using the specified
/// <paramref name="comparisonType"/>.
/// </summary>
/// <param name="this">The <see cref="NameValueCollection"/> on which this method is called.</param>
/// <param name="name">The name to look for.</param>
/// <param name="value">The value to look for.</param>
/// <param name="comparisonType">One of the <see cref="StringComparison"/> enumeration values
/// that specifies how the strings will be compared.</param>
/// <returns><see langword="true"/> if at least one of the values for <paramref name="name"/>
/// in the collection is equal to <paramref name="value"/>; otherwise, <see langword="false"/>.
/// </returns>
/// <exception cref="NullReferenceException"><paramref name="this"/> is <see langword="null"/>.</exception>
/// <remarks>White space is trimmed from the start and end of each value before comparison.</remarks>
/// <seealso cref="Contains(NameValueCollection,string,string)"/>
Determines whether a  contains one or more values
for the specified , at least one of which is equal to the specified
. Value comparisons are carried out using the specified
.
Determines whether a contains one or more values for the specified at least one of which is equal to the specified . Value comparisons are carried out using the specified .
public static bool Contains(this NameValueCollection @this, string name, string? value, StringComparison comparisonType)
        {
            value = value?.Trim();
            return @this[name]?.SplitByComma()
               .Any(val => string.Equals(val?.Trim(), value, comparisonType)) ?? false;
        }
public static bool Contains ( this NameValueCollection @this , string name , string ? value , StringComparison comparisonType ) { value = value ? . Trim ( ) ; return @this [ name ] ? . SplitByComma ( ) . Any ( val => string . Equals ( val ? . Trim ( ) , value , comparisonType ) ) ?? false ; }
Determines whether a  contains one or more values
for the specified , at least one of which is equal to the specified
.
Determines whether a contains one or more values for the specified at least one of which is equal to the specified .
if at least one of the values for
in the collection is equal to ; otherwise, .
if at least one of the values for in the collection is equal to ; otherwise .
None
NameValueCollection
this
name
string
The name to look for.
The name to look for .
value
string?
The value to look for.
The value to look for .
comparisonType
StringComparison
One of the  enumeration values
that specifies how the strings will be compared.
One of the enumeration values that specifies how the strings will be compared .
this
The  on which this method is called.
The on which this method is called .
remarks
White space is trimmed from the start and end of each value before comparison.
White space is trimmed from the start and end of each value before comparison .
seealso
None