Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 11336

Ajuda com Split

$
0
0
Tentaste fazer? É quase igual mas mais simples ainda... no botão: Dim m1lhao As String = GetMilhao(results(4)) If Not String.IsNullOrEmpty(m1lhao) Then MessageBox.Show(m1lhao) Else MessageBox.Show("problemas!") End If a função: Private Function GetMilhao(ByVal str As String) As String ' divide a string quando acha a cadeia de caracteres "</b>:" Dim strArray() As String = str.Split(New String() {"</b>:"}, StringSplitOptions.None) ' verifica se o array tem dois elementos If strArray.Length = 2 Then ' retorna o conteudo do ultimo elemento do array (podias usar "strArray.Last()") ' o "trim()" remove os spaces " " das pontas Return strArray(1).Trim() End If Return String.Empty End Function

Viewing all articles
Browse latest Browse all 11336

Trending Articles