locked
Loop through letters of the alphabet RRS feed

  • Question

  • User-451735805 posted

    How can I loop through letters of the alphabet using VB.Net?

    Thursday, January 5, 2012 9:36 AM

Answers

All replies

  • User-718146471 posted

    Refer this posting and then put that code through the c# to vb converter.

    http://forums.asp.net/post/1778402.aspx and you'll end up with this:

    Dim update1 As New UpdatePanel()
    Dim txtOutput As New TextBox()
    Dim letter As Char = "A"C

    txtOutput.TextMode = TextBoxMode.MultiLine

    For i As Integer = 0 To 25
    txtOutput.Text += letter
    letter += 1
    Next

    form1.Controls.Add(txtOutput)
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 5, 2012 9:39 AM
  • User-451735805 posted

    OK, I have found the best solution here:

    http://stackoverflow.com/questions/5434968/how-can-i-iterate-through-the-alphabet-in-visual-basic

     

    For ascii = 65 To 90
        Debug.Print(Chr(ascii))
    Next

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 5, 2012 10:35 AM
  • User-2065084747 posted

    you maybe need to create something like to loop through high-case and lower-case letters:

    For Each c In "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".ToCharArray()
        Console.WriteLine(c)
    Next

    Thursday, January 5, 2012 3:44 PM