const maxLenghtPassword = 8; ... if (texto.Lenght < maxLenghtPassword) { //melhor que por o 8 aqui, já que ele pode mudar