Results 1 to 10 of 10

Thread: Replace Array with Array

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Replace Array with Array

    Hi, I'm trying to make a project for a type of encryption - but one of the steps is screwing up.
    This is my code: (The step that is screwing up)
    Code:
        Public Sub l2n(ByVal origtext As String)
            Dim old As Array
            Dim newtxt As Array
            old = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "!", "?", """", ",", ":", ";", ".", "`", """, ""+", "-", "*", "@", "#", "$", "%", "^", "&", "(", ")", "{", "}", "[", "]", "/"}
            newtxt = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52"}
            Replace(origtext, old, newtxt)
        End Sub
    However apparently an array cannot be converted into a string, and with 52 values (as well as 26 being repeated once) I really do not wish to go through and type a replace for each and every string.
    Thanks,
    -Arightwizard
    (Visual basic 2010 - .net 4.0 framework)
    **Edit** Never mind, I think I got it.
    ***Edit*** OK, it isn't working for me. Can someone respond?
    Last edited by Arightwizard; Aug 23rd, 2009 at 04:15 PM.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width