You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/PlexRequests.UI/Helpers/StringHelper.cs

23 lines
626 B

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 ");
}
}
}