How to Change the First Letter of a Word in a TextBox from a Capital letter to a Small letter through Code

FaheemAhmadGul used Ask the Experts™
I have a   TextBox1    on a    Form1     in a Visual Basic Project in Visual Studio 2008.
Form1    also has a Command named   Button1    on it.
TextBox1 is likely to contain a sentence in it.
I would like to change the First letter of the first word of whatever sentence is written in TextBox1 from a Capital Letter to a small letter.
For example if TextBox1 has the following sentence in it
This is a table.
Clicking Button1 should change it to
this is a table.

Similarly if TextBox1 has
He is going to London.
then clicking Button1 should change this to
he is going to London.

I need help with Code for the Click event of Button1 which will achieve this for me.

Thank you for your help in anticipation.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

would changing the whole textbox to lower case be acceptable or would you like to just do the first letter.  Also are you working in C# or VB.
Put this in your button click event

TextBox1.Text = TextBox1.Text(0).ToString.ToLower + TextBox1.Text.Substring(1)

nice, go with the above


Brilliant!. Many thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial