FirstCharToUpper

  <Extension()>
  Public Function FirstCharToUpper(str As String) As String

    If String.IsNullOrEmpty(str) Then Return str

    Dim sb As New StringBuilder(str)

    sb.Chars(0) = sb.Chars(0).ToString.ToUpper

    Return sb.ToString

  End Function
Example:
    Dim lStr = "this is a test"
    Dim uStr = lStr.FirstCharToUpper()
    'uStr = This is a test

Description

Converts the first char of a string to an upper case letter.

Details

Double click on the code to select all.

 

;