I need to generate a loop that would iterate through each capital letter of the alphabet using Visual Basic (2008). What's the cleanest way to do this?
While loop is used to print the alphabets from A to Z. A loop variable is taken to display of type 'char'. The loop variable 'i' is initialized with the first alphabet 'A' and incremented by 1 on every iteration. In the loop, the character 'i' is printed as the alphabet.
For Each c In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()
...
Next
The simplest way to do this would probably be:
For ascii = 65 To 90
Debug.Print(Chr(ascii))
Next
I'm not really sure if it's the cleanest though. I haven't worked in vb.net much since I started with c#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With