Hi i want to convert only the first letter of a firstname n his lastname seperating by a space. Note every time he/she input firstname the first letter should be Uppercase and when she/he press the space bar the last name only the first letter should be Uppercase.
Help Me Plzzzz
Ex:
Geeta Lopez

Recommended Answers

All 2 Replies

private string MakeFirstUpperMakePascalCase( string name )

{ if ( name.Length <= 1) return name.ToUpper(); return Char.ToUpper( name[0] ).ToString() + name.Substring( 1 ); Char[] letters = name.ToCharArray(); letters[0] = Char.ToUpper( letters[0] ); return new string( letters );}

Mr. Ramesh has given very best way/solution, but there is an easy way for that.
There is one function called StrConv it can be used to do your required stuf only in one line code. which is as follow.
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = StrConv(TextBox1.Text, VbStrConv.ProperCase)
End Sub
End Class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.