Quick VB6 Split String help

Associate
Joined
1 Mar 2006
Posts
425
hi Guys


string is:

":USERNAME![email protected] PRIVMSG #Channel :Hello World"



i need to split the string to show

USERNAME:Hello World


im currently using the below


Dim Msg As String
Msg = Split(Data, " PRIVMSG " & Channel & " :")(1)

which returns

USERNAME:

and no hello world what am i doing wrong here? ive done this a million times in the past :confused:
 
thanks for that

the string is coming through a socket from a IRC server

i thought about


Code:
Dim Msg As String

Dim Msg2 As string

Dim msg3 as string

 

Msg = Split(Data, " PRIVMSG " & Channel & " :")(1) ‘ which gives you “USERNAME”

 

Msg2 = Split(Data, " PRIVMSG " & Channel & " :")(2) ‘ which should give you “:hello world”

 

 

Then concentrate msg and msg2 into msg3 dimension? To get USERNAME:hello world

 

Text1.text = (msg3) ‘ show concentrated string in textbox


Or is that just rubbish
 
Back
Top Bottom