If the string is > 8, I need to remove the last character
How is this possible?
private void textBoxNewPassword_TextChanged(object sender, EventArgs e)
{
if (textBoxNewPassword.TextLength == 9)
textBoxNewPassword.Text = textBoxNewPassword.Text.Remove((textBoxNewPassword.Text.Length - 1), 1);
}
The code appears to do nothing.
Use String.Substring Method (Int32, Int32), where the first parameter is the starting index and 2nd parameter is the number of characters. Also if you need to check if the length is greater than 8 the do: