Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Function returnPlayerNames(val As String) As List(Of PlayerClass)
- Dim ex As String = """id"":(.*?),?""name"":""(.*?)"",""ping"":(.*?)}" ''"id":(.*?),|"name":"(.*?)","ping":(.*?)}
- Dim mc As MatchCollection = Regex.Matches(val, ex)
- Dim ma As Match
- Dim data As List(Of String) = New List(Of String)
- Dim pclass As List(Of PlayerClass) = New List(Of PlayerClass)
- For Each ma In mc
- Dim s() As String = Split(ma.Groups(1).Value, ",")
- Dim player As PlayerClass = New PlayerClass With {
- .id = s(0),
- .Name = ma.Groups(2).Value,
- .Ping = ma.Groups(3).Value
- }
- pclass.Add(player)
- Next
- Return pclass
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement