/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/SystemPath.cs
26 строк
809 B
Davide Giacometti
[Build] Upgraded NetAnalyzers to 7.0.1 (#24792)
16 мар 2023, 17:51
Не верифицирован
16 мар 2023, 17:51
5cbe9dd
Код
Авторство
О чём код?
// 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.Text.RegularExpressions; namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces { internal sealed 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; } } } }