[RESOLVED] VB Server - Java Client
I am writing a program that will be using sockets in both java & vb to transmit information. I have already figured out how to connect and send the data, not a prob there. However my issue lies in parsing the data, Java when sending the data seems to be putting out a terminator of some sort prefixed before every character it sends out, it is like this symbol: □ what do I need to do to parse it out? Because it is chopping off the data that is read in my list view.
Example of how the data is sent:
□H□e□l□l□o□ □W□o□r□l□d□!
Re: VB Server - Java Client
Every "correct" character is at even index in your String... so use Mod() in a loop:
VB Code:
Dim oldString As String
oldString = "□H□e□l□l□o□ □W□o□r□l□d□!" 'this is where you retrieve your String for example
Dim N As Long
Dim newString As String
For N = 1 To Len(oldString)
If N Mod 2 = 0 Then
newString = newString & Mid(oldString, N, 1)
End If
Next N
Debug.Print newString 'returns "Hello World!"
Re: VB Server - Java Client
Thanks, looks promising, added a point to your reputation.