String doesn't equal string?
I've been having a glitch in my program for the last couple of hours in development. After some investigation, shows that one of my string variables apparently not what it says it is.
Lets take a look:
Now I did edit the photo so you could see the msgbox (which normally wouldn't appear until the next line, I wanted to show it directly next to the tip showing that cT = "dog").
Now, my cT variable is scrapped and read from a stream sent by a junk server I made. Is there a way to turn cT purely into what it says it is? It says it's "dog" but something tells me there are some hidden bytes in there or something not showing. Seeing as "dog" != "dog, does that make any sense?
Thanks for any help you can provide, at this point, I'm baffled. I'll probably go play some Portal.
edit: Portal just crash开发者_如何学JAVAed, bad day I guess :/
edit, here is some code:
Dim cT As String = msg.Split("|")(4).Trim.ToLower
MsgBox(cT.Length)
Dim oct As String = Name.ToLower()
If StrConv(oct, VbStrConv.Lowercase).Contains(StrConv(cT, VbStrConv.Lowercase)) Then
msend.nMessage(msg.Split("|")(2).Trim & " > All", msg.Split("|")(3))
End If
I'm using VB.net so all .net answers are acceptable.
There are probably some invisible characters like 13, 10, or 0 in cT. To see what is really in the string cT, use test code something like this:
For i = 0 To cT.Length - 1
MsgBox(Asc(cT.Chars(i)))
Next i
Is there an embedded newline, backspace, or something funky? That can cause WYSI(not)WYG issues...
精彩评论