NameValueCollectionExtensions.TryGetBoolean method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Collections.Extensions
Assembly Skybrud.Essentials.dll

TryGetBoolean(NameValueCollection, string, out bool)

Extension method

Gets the boolean value associated with the specified key.

public static bool TryGetBoolean(this NameValueCollection collection, string key, bool result)

Parameters

collection NameValueCollection

The collection.

key String

The key of the item.

result bool

When this method returns, contains the boolean value associated with the specified key, if the key is found and the the conversion succeeded; otherwise false.

Returns

true if an item with key was found converted successfully; otherwise, false.