You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/NzbDrone.Common/Extensions/TryParseExtensions.cs

31 lines
614 B

using System;
namespace NzbDrone.Common
{
public static class TryParseExtensions
{
public static Nullable<int> ParseInt32(this string source)
{
Int32 result = 0;
if (Int32.TryParse(source, out result))
{
return result;
}
return null;
}
public static Nullable<long> ParseInt64(this string source)
{
Int64 result = 0;
if (Int64.TryParse(source, out result))
{
return result;
}
return null;
}
}
}