#139 remove dependency and usage of humanize() - should help with cross-platform issues. start using moment.js

This commit is contained in:
Drewster727 2016-04-05 13:33:06 -05:00
parent c882a41eb1
commit fb66f5aca8
12 changed files with 890 additions and 24 deletions

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