[help] Spliting like irc

Posts 1–5 of 5 · Page 1 of 1
[help] Spliting like irc
Code:
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click

        If txtPost.Text <> "" Then
            If txtUsername.Text <> "" Then
                
            
                ShoutBox.AddPost(frmMain.txtLid.Text, txtPost.Text, )
                txtPost.Text = ""

            Else

            End If

        Else
            MsgBox("Please fill in a post.", MsgBoxStyle.Information)
        End If
    End Sub
this is the submit chat code

how would i split the text so i can code irc type commands

such as

/title {input}

| = split

i want to split the / | my.settings.title | "{input}"

and the
if txtpost.text = "/title" split {input} then
lable1.text = "{output}"
end if

please and thankyou
Quote Originally Posted by cosconub View Post
Code:
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click

        If txtPost.Text <> "" Then
            If txtUsername.Text <> "" Then
                
            
                ShoutBox.AddPost(frmMain.txtLid.Text, txtPost.Text, )
                txtPost.Text = ""

            Else

            End If

        Else
            MsgBox("Please fill in a post.", MsgBoxStyle.Information)
        End If
    End Sub
this is the submit chat code

how would i split the text so i can code irc type commands

such as

/title {input}

| = split

i want to split the / | my.settings.title | "{input}"

and the
if txtpost.text = "/title" split {input} then
lable1.text = "{output}"
end if

please and thankyou
I don't get what you're trying to say lol. Needs moar English
let me some it up...

i want to beable to type

/title mytext in to my chatbox and click submit
and instead of posting it changes lable1.text to mytext
Dim yourstring as string = "/title blubb"
Dim x() as string = yourstring.split(" ")

msgbox(x(1))

If that does not work, use regex.split.
Or something like this:

[php]
If TextBox1.Text.StartsWith("/") Then
Dim firstInd As integer = TextBox1.Text.IndexOf(" "c)
Dim command As String = TextBox1.Text.Substring(1, firstInd)
Dim content As String = TextBox1.Text.SubString(firstInd+1)
If command.ToLower = "title" then
Label1.Text = content
End If
End If
[/php]
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us