Hi experts,
i use socket to receive string in unicode format
it works, i can receive and decode text using this :
ReDim bytes(128)
bytesReceived = mySocket.Receive(bytes, bytes.Length, SocketFlags.None)
eventReceived = System.Text.Encoding.Unicode.GetString(bytes, 0, bytesReceived).TrimEnd(Convert.ToChar(0))
eventReceived = eventReceived.Trim
but the problem is :
when i read the "EventReceived" and after trimming i got (e.g.) :
"test 1"
but when i'm checking the length, the string has a value of 100 character!!!
how can i cleanup the string?
Regards
i use socket to receive string in unicode format
it works, i can receive and decode text using this :
ReDim bytes(128)
bytesReceived = mySocket.Receive(bytes, bytes.Length, SocketFlags.None)
eventReceived = System.Text.Encoding.Unicode.GetString(bytes, 0, bytesReceived).TrimEnd(Convert.ToChar(0))
eventReceived = eventReceived.Trim
but the problem is :
when i read the "EventReceived" and after trimming i got (e.g.) :
"test 1"
but when i'm checking the length, the string has a value of 100 character!!!
how can i cleanup the string?
Regards