mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-26 09:37:12 +00:00
20 lines
375 B
C#
20 lines
375 B
C#
|
using System;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|