Im taking a VB class and cant figure out how to get it to replace more than one character this is my code.
VB Code:
Option Explicit On Option Strict On Public Class JacobsonForm Inherits System.Windows.Forms.Form Private Sub uiExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiExitButton.Click 'ends the application Me.Close() End Sub Private Sub uiDisplayButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiDisplayButton.Click Dim oldpass As String = Me.uiOldPassTextBox.Text Dim oldpassnumber As Double Dim newpass As String Dim i As Integer = 0 oldpassnumber = oldpass.Length If oldpassnumber >= 5 AndAlso oldpassnumber < 8 Then Do Until i = oldpassnumber newpass = oldpass.Replace("A", "X") newpass = oldpass.Replace("E", "X") newpass = oldpass.Replace("I", "X") newpass = oldpass.Replace("O", "X") newpass = oldpass.Replace("U", "X") i = i + 1 Loop End If Me.uiNewPassLabel.Text = newpass End Sub End Class
what am i missing i tried to get it to loop, but it only does the U, how can i get to do them all?




Reply With Quote