Advertisement
TermSpar

CS Final (By Ben Bollinger)

Jan 14th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.41 KB | None | 0 0
  1. Public Class Form1
  2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3. Dim test as string
  4. Dim counter as integer
  5. Dim counter2 as Integer
  6. test = txtTest.text
  7. For Each a in test.text
  8.     If a = "a" Then
  9.         counter += 1
  10.     ElseIf a = "A" Then
  11.         counter2 += 1
  12.     End If
  13.         Next
  14. MsgBox("Amount of a's: " & counter & ", amount of A's: " & counter2)
  15.     End Sub
  16. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement