|
Rank: Guest
Joined: 12/12/2009(UTC) Posts: 443 Points: 1,361
|
Soan;361 wrote:If your input box is a textbox with name as TextBox1, then you can use the following code line to get the first character of the string entered by user in TextBox1. TextBox1.Text = TextBox1.Text.Substring(0, 1)
Substring(0,1) --> 0 here means the starting point which is in our case is the first letter. You can change the starting point as per your requirement. But remember that the counting always starts from zero (0). 1 here means how many characters whiic in our case is 1 character. if you want to get more than 1 charcters from start of string, you can change this value as per your requirement. How do you do that for multiple words where "Hello How are you today?" becomes (h h a y t)?
|