Friday, July 10, 2015

Simple title case function for ASP.NET in VB. DotNet .NET title case. Capitalise first letter .NET

So first time today i realised there is no inbuilt function in .net to convert a string to title case (capitalise the first letter).  Seems crazy that you have to make your own.  anyway heres a really simple function in VB.NET


   Function toTitleCase(ByVal strIn As String) As String

        Return (UCase(Left(strIn, 1)) & Right(strIn, strIn.Length - 1))

   End Function