Reihenfolge vertauschen

  • VB.NET

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von Mono.

    VB.NET-Quellcode

    1. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    2. Dim Rand As New Random
    3. Dim oldt = TextBox1.Text
    4. Dim RandNr
    5. Do
    6. RandNr = Rand.Next(TextBox1.TextLength) + 1
    7. Loop Until RandNr > 1
    8. TextBox2.Text = Mid(oldt, 1, RandNr - 2) & Mid(oldt, RandNr, 1) & Mid(oldt, RandNr - 1, 1) & Mid(oldt, RandNr + 1)
    9. End Sub


    man könnte es so machen, möglicherweise ginge es auch einfacher :)
    Textbox1.Text und Textbox2.text sind deine beiden Variablen
    Das ist meine Signatur und sie wird wunderbar sein!