Files
PowerToys/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/SystemPath.cs
CleanCodeDeveloper ba525f068b [PTRun][VSCodeWorkspaces] Enable analyzer and fix warning (#16897)
* [Community.PowerToys.Run.Plugin.VSCodeWorkspaces] Enable analyzer and fix warnings

* fix CA1824: Mark assemblies with NeutralResourcesLanguageAttribute
2022-03-10 10:37:14 +00:00

28 lines
830 B
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Globalization;
using System.Text.RegularExpressions;
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
{
internal class SystemPath
{
private static readonly Regex WindowsPath = new Regex(@"^([a-zA-Z]:)", RegexOptions.Compiled);
public static string RealPath(string path)
{
if (WindowsPath.IsMatch(path))
{
string windowsPath = path.Replace("/", "\\");
return $"{windowsPath[0]}".ToUpperInvariant() + windowsPath.Remove(0, 1);
}
else
{
return path;
}
}
}
}