Answer the question
In order to leave comments, you need to log in
Checking conditions on letters?
string bukv = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (textBox.Text != bukv)
{
}
else
{
MessageBox.Show("Ошибка: Регистр букв должен быть большим и на Английском языке.");
}
Answer the question
In order to leave comments, you need to log in
Well, you can raise the register yourself - you won’t break and you probably shouldn’t throw an error about it. And the letters themselves are checked by regular expressions - and quite simple ones. If you are really bad with them - https://regex101.com you can practice here.
bool state = false;
foreach(ch in textBox.Text)
{
if(!char.IsUpper(ch))
state = true;
}
if(state)
MessageBox.Show("Ошибка: Регистр букв должен быть большим и на Английском языке.");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question