1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Test.Common/StringExtensions.cs

22 lines
562 B
C#
Raw Normal View History

2013-07-26 08:00:57 +03:00
using System.IO;
using NzbDrone.Common.EnvironmentInfo;
namespace NzbDrone.Test.Common
{
public static class StringExtensions
{
public static string AsOsAgnostic(this string path)
{
if (OsInfo.IsLinux)
{
if (path.Length > 2 && path[1] == ':')
{
path = path.Replace(':', Path.DirectorySeparatorChar);
}
path = path.Replace("\\", Path.DirectorySeparatorChar.ToString());
}
return path;
}
}
}