how do you use MID function in visual basics to search for a certain number of characters but not counting space for example:

Dim homesaverStorage1 As String = Mid(Textbox2.Text, 1, 255)
Dim homesaverStorage2 As String = Mid(Textbox2.Text, 256, 255)
Dim homesaverStorage3 As String = Mid(Textbox2.Text, 511, 255)
Dim homesaverstorage4 As String = Mid(Textbox2.Text, 766, 255)
Dim homesaverstorage5 As String = Mid(Textbox2.Text, 1021, 255)


this method is taking the text in textbox 2 and storing them in 5 storages, but when we are counting the numbers, we are counting spaces. how do we exclude spaces?