C# DateTime Usage

Below are a couple of methods for working with DateTime objects easier that I thought I’d collate into a single post. Default Value When using a newly initialised DateTime object as a source for an input field in an MVC project it will default to 01/01/0001. In order to set Read more…

Upper Case the First Letter of a String

Upper Case the First Letter of a String This is a simple string extension for upper casing the first letter of a string, the code originally came from here. public static class StringExtensions { public static string FirstLetterToUpperCase(this string s) { if (string.IsNullOrEmpty(s)) throw new ArgumentException(“There is no first letter”); Read more…