"How is the textbox organised?
Is it multiline and the numbers each on separate lines, or is are they separated by semicolons, or what?"
tharukanc 22 mins ago
"for each line one number"
Then they are already separated: a multiline TextBox has a Lines property which returns each separate line as a single string within an array:
string[] numbers = myTextBox.Lines;
You can use a simple
foreach
loop to process each of them, and removing spaces for each is trivial:
foreach (string line in numbers)
{
string number = line.Replace(" ", "");
... send SMS to number using your working code.
}