StringExtensions.cs 530 Bytes
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;

namespace AIAHTML5.Server.Models
{
    public static class StringExtensions
    {
        public static string ToTitleCase(this string text)
        {
            return CultureInfo.InvariantCulture.TextInfo.ToTitleCase(text);
        }

        public static DateTime ToDateTime(this string date)
        {
            return DateTime.ParseExact(date, "d/M/yyyy", CultureInfo.InvariantCulture);
        }
    }
}