Results 1 to 3 of 3

Thread: Split a string

  1. #1
    Phrozeman
    Guest

    Split a string

    Ello peoples,

    Still working on a small IRC Example, and got a little stuck.
    When i receive a string, i need to split it and send only 1 word back to an channel... But how do i have to split this String:

    [email protected] JOIN :#testchannel

    The only thing i need it the nickname before the !

    VB Code:
    1. Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
    2. On Error Resume Next
    3. Dim Data As String
    4. Dim Params As String
    5.  
    6. If InStr(1, Data, "JOIN") Then
    7. Params = Replace(Split(UCase(Data)(0), "!"), vbCrLf, "")
    8.  
    9.     Winsock2.SendData "PRIVMSG " & "#testchannel" & " :Hello " & Params & vbCrLf
    10.      Exit Sub
    11. End If

  2. #2
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    dim a() as string
    a = split(data,"!")
    msgbox a(0)
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  3. #3
    Phrozeman
    Guest
    Works fantastic
    Thanks pall

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width