NameValueCollectionExtensions.TryGetInt32 method

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

TryGetInt32(NameValueCollection, string, out int)

Extension method

Gets the int value associated with the specified key.

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

Parameters

collection NameValueCollection

The collection.

key String

The key of the item.

result int

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

Returns

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