Skip to main content

Write a VB a program to accept a string from user if the string contain any integer number that get replaced by *.

· One min read
Kaustubh Kulkarni
file.vb
  
Private Sub Command1_Click()

Dim str As String
Dim str1 As String
str = Text1.Text
str1 = Replace(str, "9", "*")
str1 = Replace(str1, "8", "*")
str1 = Replace(str1, "7", "*")
str1 = Replace(str1, "6", "*")
str1 = Replace(str1, "5", "*")
str1 = Replace(str1, "4", "*")
str1 = Replace(str1, "3", "*")
str1 = Replace(str1, "2", "*")
str1 = Replace(str1, "1", "*")
str1 = Replace(str1, "0", "*")
Text1.Text = str1
End Sub