What I am trying to do is split a string, depending on its length, so I can assign certain sections of it, to different textboxes.
if (str.Length <= 2)
{
textbox1.Text = str; //(the first textbox is 2 characters long, so this is fine)
}
else if() //this is where I need to split the first two characters
//into the first textbox, then the next 2 into a second
//textbox, than anything left over into the third textbox
Say the value of the string is 123456789, I would want 89 in the first box, 67 in the second, and 12345 in the third, if that makes sense.
Something like this?
Edit: Oh, you’re going backwards. Fixed.
Edit 2: I’m sick of
Substringand math 🙂