Here's some code that I tested in a small Windows Forms app. You can change the strings to match your names.
private void FixAddressBtn_Click(object sender, EventArgs e)
{
const int maxLength = 25;
if (LongAddressText.Text.Length <= maxLength)
{
Address1Text.Text = LongAddressText.Text;
Address2Text.Text = string.Empty;
return;
}
for (int i = maxLength - 1; i >= 0; --i)
{
if (LongAddressText.Text[i] == ' ')
{
Address1Text.Text = LongAddressText.Text.Substring(0, i);
Address2Text.Text = LongAddressText.Text.Substring(i+1);
return;
}
}
//no obvious way to split it, so just brute force:
Address1Text.Text = LongAddressText.Text.Substring(0, 24);
Address2Text.Text = LongAddressText.Text.Substring(24);
}
It walks backwards from your "maximum length for Address1" value until it finds a space and breaks there. Getting rid of the space was the hardest part (off-by-one errors, etc.). It doesn't handle multiple spaces, and it doesn't handle arbitrary whitespace (for example, TABs). But it should do what you asked in the most obvious way.