Okay, you can fix the second version by doing:
Dim CommandB As String = String.Empty
However, it looks like you are just tring to increment a string there so try changing it to this:
Dim CommandB As StringBuilder = New StringBuilder()
Do Until RectString(ICount) = EofCharacter
ICount += 1
If RecString(ICount) = EofCharacter Break
CommandB.Append(RecString(ICount))
In your example, you are comparing a character to a string "EOF" is a string, so you need to convert the EOF marker into a character.