Start with upper case


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'**********************************************************************************************************
' Name:                 startsWithUpper
' Author:               mielk | 2013-06-05
'
' Comment:              Converts the first letter of the given string to upper case.
'                       The rest of the string remains unchanged.
'
' Parameters:
'   text                String to be converted.
'
' Returns:
'   String              The original string with the first letter converted to the upper case.
'
'
' --- Changes log -----------------------------------------------------------------------------------------
' 2013-06-05        mielk           Method created.
'**********************************************************************************************************
Public Function startsWithUpper(ByVal text As String) As String
    Const METHOD_NAME As String = "startsWithUpper"
    '------------------------------------------------------------------------------------------------------

    startsWithUpper = VBA.UCase$(VBA.Left$(text, 1)) & VBA.Mid$(text, 2)

End Function