string[] lines = { textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text };
Random RandString = new Random();
string text = lines[RandString.Next(0, lines.Length)];
SendKeys.SendWait(text);
How can I select textBox’s with text inside of them? I was trying to sort the data string[] lines into a new string[] hasText but I’m unsure how to go about checking if the textBox has text inside of it.
If the textBox field is null it will still process through RandString and SendKeys will try to type it out. How can I fix this?
Thanks.
You could filter the array with LINQ: