VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show(ProperCase("john doe"))
End Sub
Private Function ProperCase(ByVal inString As String) As String
Dim strBuffer As String
Dim strItem As String
If Not inString.Length = 0 Then '/// make sure the string isn't empty
If Not inString.IndexOf(" ") = -1 Then '/// if there's spaces / more than one word.
For Each strItem In inString.Split(" ")
strBuffer += strItem.Substring(0, 1).ToUpper & strItem.Substring(1) & " "
Next
Else '/// if it's only one word ( eg: first name )
strBuffer = inString.Substring(0, 1).ToUpper & inString.Substring(1)
End If
End If
Return strBuffer.TrimEnd(" ")
End Function