/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/fancyzones/FancyZonesEditorCommon/Utils/StringUtils.cs
22 строки
681 B
Seraphima Zykova
[FancyZones]UI testing that works in CI (#29453)
22 мар 2024, 15:10
Не верифицирован
22 мар 2024, 15:10
f6e7635
Код
Авторство
О чём код?
// 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 FancyZonesEditorCommon.Utils { public static class StringUtils { public static string UpperCamelCaseToDashCase(this string str) { // If it's single letter variable, leave it as it is if (str.Length == 1) { return str; } return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "-" + x.ToString() : x.ToString())).ToLowerInvariant(); } } }