mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
22 lines
626 B
C#
22 lines
626 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace PlexRequests.UI.Helpers
|
|
{
|
|
public static class StringHelper
|
|
{
|
|
public static string FirstCharToUpper(this string input)
|
|
{
|
|
if (String.IsNullOrEmpty(input))
|
|
return input;
|
|
|
|
return input.First().ToString().ToUpper() + String.Join("", input.Skip(1));
|
|
}
|
|
|
|
public static string CamelCaseToWords(this string input)
|
|
{
|
|
return Regex.Replace(input.FirstCharToUpper(), "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1 ");
|
|
}
|
|
}
|
|
}
|