1
Answer

how to fix null error with regex.match.group.value

jorge juan

jorge juan

5y
817
1
Friend Sub DetectBaseUrl()
Dim domain As String = Nothing
Dim match As String = Regex.Match(GmailClient.Username, ".+@(.+)").Groups(1).Value
If match = String.Empty AndAlso Not New String() {"gmail.com", "googlemail.com", "googlemail.co.uk"}.Contains(match) Then
domain = match
End If
BaseUrl = "http://mail.google.com" + (If((domain IsNot Nothing), ("/a/" + domain), Nothing))
End Sub
Answers (1)