StringExtensions.cs
533 Bytes
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
namespace DentalDecks.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);
}
}
}