Public Function checkCharacters(ByVal str As String) As String Dim temp As String = "" Dim f As String = "" Dim s As String = "" For i = 0 To str.Length - 1 For j = i + 1 To str.Length - 2 If str(i) = str(j) Then temp += str(i).ToString() If temp.Length >= 4 Then Return temp.ToString() End If Else temp += "" End If Next Next Return "" End Function Private Sub btnCheck_Click(sender As Object, e As EventArgs) Handles btnCheck.Click Dim str As String = txtStringtoCheck.Text Dim sd As New StringsDelimiter Dim result As String = checkCharacters(str) Try If result.Length >= 4 Then MsgBox("Please entered repeat characters " & result.ToString()) End If Catch ex As Exception MsgBox(ex.Message()) End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)