mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02: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