/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/Workspaces/WorkspacesEditor/Utils/StringUtils.cs
19 строк
643 B
Josh Soref
Upgrade to check-spelling v0.0.24 (#36235)
06 дек 2024, 19:33
Не верифицирован
06 дек 2024, 19:33
74a1a6e
Код
Авторство
О чём код?
// 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.Linq; namespace WorkspacesEditor.Utils { public static class StringUtils { public static string UpperCamelCaseToDashCase(this string str) { // If it's a single letter variable, leave it as it is return str.Length == 1 ? str : string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "-" + x.ToString() : x.ToString())).ToLowerInvariant(); } } }