mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 19:40:05 -07:00
#139 remove dependency and usage of humanize() - should help with cross-platform issues. start using moment.js
This commit is contained in:
parent
c882a41eb1
commit
fb66f5aca8
12 changed files with 890 additions and 24 deletions
22
PlexRequests.UI/Helpers/StringHelper.cs
Normal file
22
PlexRequests.UI/Helpers/StringHelper.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
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 ");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue