Public Class Form1
Dim myarr() As Char 'create an array to hold the specil characters'
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TextBox1.Text = "Hi! Hello, How are you?"
myarr = {"[", "!", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "\", "-", ".", "/", ":", ";", "<", "=", ">", "?", "@", "]", "^", "_", "{", "|", "}", "~", "ยง"}
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Application.Exit()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim n As Integer = Len(myarr)
Dim i As Integer
For i = 0 To n - 1
If TextBox1.Text.Contains(myarr(i)) Then
Debug.Print(myarr(i))' print character if found
End If
Next
End Sub
End Class
SoftBa commented: Thanks man. This is behavior I was looking for. +2
Paturo.po commented: It doesn't work Sir. +0
JamesCherrill commented: Well said +14
ddanbe commented: Helpful. +15
rproffitt commented: Starts up Peter Gabriel's Sledgehammer. Thanks. https://www.youtube.com/watch?v=g93mz_eZ5N4 +11