Question : vb.net - extract data

hello there,
I would like to know how can I extract data from a textbox.. the text that I want to extract is 5372b00c21b6e640
how can I do that?
1:
2:
3:
4:
Set-Cookie: name_TID=b803a0eed64e310b; Domain=.domain.com; HttpOnly
Set-Cookie: name_TID=3e6350856763bb96; Domain=.domain.com; HttpOnly
Set-Cookie: name_TID=5372b00c21b6e640; Domain=.domain.com; HttpOnly
Set-Cookie: name_TID=d03b7b40eddb41b1; Domain=.domain.com; HttpOnly

Answer : vb.net - extract data

Here's one way to do it:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Lines.Count >= 2 Then
            Dim line As String = TextBox1.Lines(2) ' third line
            Dim vals() As String = line.Split("=")
            If vals.Length >= 1 Then
                Dim value As String = vals(1).Split(";")(0)
                Label1.Text = value
            End If
        End If
    End Sub
Random Solutions  
 
programming4us programming4us