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.
31 lines
610 B
31 lines
610 B
using System;
|
|
|
|
namespace NzbDrone.Common.Extensions
|
|
{
|
|
public static class TryParseExtensions
|
|
{
|
|
public static int? ParseInt32(this string source)
|
|
{
|
|
int result = 0;
|
|
|
|
if (int.TryParse(source, out result))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static Nullable<long> ParseInt64(this string source)
|
|
{
|
|
long result = 0;
|
|
|
|
if (long.TryParse(source, out result))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
} |