it has two textbox
i m put data in textbox1 and find output in textbox2
i want to do mulipal replace text in textbox2
like
Quote
"KB" to "kilobyte"
"MB" to "megabyte"
"GB" to "gigabyte"
"TB" to "terabyte"
"MB" to "megabyte"
"GB" to "gigabyte"
"TB" to "terabyte"
For this i m using this Code
[ Check Links ]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = TextBox1.Text
Dim i As Integer = 0
Do While i < 1000
i = i + 1
If InStr(TextBox2.Text, "kb") Then
TextBox2.Text = Replace(TextBox2.Text, "kb", "kilobyte")
ElseIf InStr(TextBox2.Text, "mb") Then
TextBox2.Text = Replace(TextBox2.Text, "mb", "megabyte")
ElseIf InStr(TextBox2.Text, "gb") Then
TextBox2.Text = Replace(TextBox2.Text, "gb", "gigabyte")
ElseIf InStr(TextBox2.Text, "tb") Then
TextBox2.Text = Replace(TextBox2.Text, "tb", "terabyte")
End If
Loop
End Sub
Is there any other way to make it easier !!
Sign In
Register
Help
Forums
Members
Help
Calendar
Search
Katz


Back to top
MultiQuote