mirror of
https://github.com/Radarr/Radarr
synced 2024-12-28 02:40:01 +00:00
19 lines
356 B
C#
19 lines
356 B
C#
|
using System;
|
|||
|
|
|||
|
namespace NzbDrone.Common
|
|||
|
{
|
|||
|
public static class TryParseExtension
|
|||
|
{
|
|||
|
public static Nullable<int> ParseInt32(this string source)
|
|||
|
{
|
|||
|
Int32 result = 0;
|
|||
|
|
|||
|
if (Int32.TryParse(source, out result))
|
|||
|
{
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
return null;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|