string fullname = Name_txt.Text; string val2, val3; if (fullname.Length >= 20) { val2 = fullname.Substring(0, 14); val3 = fullname.Substring(14, 6); } else { // show validation message to the user to enter 20+ characters }
string fullname = "Name_txt.Text"; string val2, val3; if (fullname.Length <= 14) val2 = fullname.Substring(0, fullname.Length); else { val2 = fullname.Substring(0, 14); if (fullname.Length <= 20) val3 = fullname.Substring(14, fullname.Length - 14); else val3 = fullname.Substring(14, 6); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)