0

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

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Alekhan
0

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 );}

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.