dcsimg
Results 1 to 5 of 5

Thread: read string into array

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    8

    read string into array

    I have a textbox which contain 26 letters as a single word (no spaces)
    Converted that to a variable cipheralphabet =TexxtboxCipher.text (cipheralphabet variable was already defined as string)

    I want to read those letters into an array. I am very new to VB.net so this is probably something simple that I yet do not understand

    None of these work

    For counter = 0 To 25
    arrCipher(counter) = CipherAlphabet(counter + 1).ToString()
    Next

    For counter = 1 To 26
    arrCipher(counter -1 ) = CipherAlphabet(counter).ToString()
    Next

    For counter = 0 To len(cipheralphabet)
    arrCipher(counter) = CipherAlphabet(counter + 1).ToString()
    Next

    The following gives no error but I have no way to know whether it is correct

    For counter = 0 To 25
    arrCipher(counter) = CipherAlphabet.Substring(counter, 1)
    Next


    What am I doing wrong?

    Is there an easy way (one liner hopefully) to display the contents of an array to check for errors as you code?



    Also if you could recommend a video playlist or website that I can/should use as a reference guide I would truly appreciate it.

    Microsoft . Docs appears to think you understand what you are doing in order to understand what they write. Kind of redundant methinks, if you knew what you were doing you wouldn't use it, if you don't know what you are doing its the most beginner unfriendly way to help

    Thanks in advance
    Last edited by efanton; Aug 20th, 2019 at 05:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width