mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-01-01 02:26:01 +01:00
Moved source code under src folder - massive change
This commit is contained in:
23
src/NzbDrone.Test.Common/StringExtensions.cs
Normal file
23
src/NzbDrone.Test.Common/StringExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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 = Path.DirectorySeparatorChar + path;
|
||||
}
|
||||
path = path.Replace("\\", Path.DirectorySeparatorChar.ToString());
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user