mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-19 08:21:22 +00:00
15 lines
397 B
C#
15 lines
397 B
C#
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
namespace FSO.Common.Utils
|
|||
|
{
|
|||
|
public static class PathCaseTools
|
|||
|
{
|
|||
|
public static string Insensitive(string file)
|
|||
|
{
|
|||
|
var dir = Directory.GetFiles(Path.GetDirectoryName(file));
|
|||
|
return dir.FirstOrDefault(x => x.ToLowerInvariant().Replace('\\', '/') == file.ToLowerInvariant().Replace('\\', '/'));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|