Hmmm....the ToTitleCase method of the TextInfo object works like someone
else suggested here.
Or you could use regular expressions with a delegate function as in the code
below. I think the TotitleCase method would be much faster for iterative
operations...maybe
Ibrahim Malluf
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim MyReg As New System.Text.RegularExpressions.Regex("\b\w*\b",
System.Text.RegularExpressions.RegexOptions.IgnoreCase)
Me.TextBox1.Text = MyReg.Replace(Me.TextBox1.Text, AddressOf Capitalize)
End Sub
Private Function Capitalize(ByVal m As System.Text.RegularExpressions.Match)
As String
If m.Value.Length > 1 Then
Capitalize = m.Value.Substring(0, 1).ToUpper & m.Value.Substring(1)
Else
Capitalize = m.Value.ToUpper
End If
End Function