vb6 MID function- to C# what does it become?

  • 12 years ago

    Sub crypt(PASS As String, strg As String)

    a = 1

    For I = 1 To Len(strg)

    b = Asc(Mid$(PASS, a, 1)): a = a + 1: If a > Len(PASS) Then a = 1

    Mid$(strg, I, 1) = Chr$(Asc(Mid$(strg, I, 1)) Xor b)

    Next

    End Sub

  • 12 years ago

    Try Substring http://msdn.microsoft.com/en-us/library/system.string.substring(VS.71).aspx

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook