NameValueCollectionExtensions.TryGetValue method

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

TryGetValue(NameValueCollection, string, out string)

Extension method

Gets the value associated with the specified key.

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

Parameters

collection NameValueCollection

The collection.

key String

The key of the item.

result String

When this method returns, contains the value associated with the specified key, if the key is found; otherwise null.

Returns

true if the NameValueCollection contains an element with the specified key; otherwise, false.