Bear with me- I'm sure this is a really easy question:
I'm reading a line from a fixed-width file that looks something like this:
JOHN DOE 123 MAIN ST NEW YORK
I want to preserve the whitespace when I read the file, but I don't know how to do that.
This is what I'm doing:
x = myStreamReader.ReadLine
label1.text = x.Substring(1,15)
label2.text = x.Substring(16,20)
label3.text = x.Substring(21,10)
label1 should be 'JOHN DOE ' (without the quotes of course)
label2 should be '123 MAIN ST '
label3 should be 'NEW YORK '
But what it's doing is setting label1 to 'JOHN DOE 123 MA'
Can anyone tell me how to preserve the whitespace?
Thanks!
Suzanne
I'm reading a line from a fixed-width file that looks something like this:
JOHN DOE 123 MAIN ST NEW YORK
I want to preserve the whitespace when I read the file, but I don't know how to do that.
This is what I'm doing:
x = myStreamReader.ReadLine
label1.text = x.Substring(1,15)
label2.text = x.Substring(16,20)
label3.text = x.Substring(21,10)
label1 should be 'JOHN DOE ' (without the quotes of course)
label2 should be '123 MAIN ST '
label3 should be 'NEW YORK '
But what it's doing is setting label1 to 'JOHN DOE 123 MA'
Can anyone tell me how to preserve the whitespace?
Thanks!
Suzanne