vb.net - Replace integers in a string using Visual Basic -
i trying replace integers in string using visual basic , can't seem right.
this have:
lblnewpassword.text = txtorigpassword.text.replace("[0-9]", "z")
i have tried:
lblnewpassword.text = txtorigpassword.text.replace("#", "z")
and:
lblnewpassword.text = txtorigpassword.text.replace("*#*", "z")
you have use regex object this:
c#
string input = "this t3xt n4mb3rs."; regex rgx = new regex("[0-9]"); string result = rgx.replace(input, "z");
vb
dim input string = "this t3xt n4mb3rs." dim rgx new regex("[0-9]") dim result string = rgx.replace(input, "z")
update: if want change vowels x
can add:
rgx new regex("[a-za-z]") result = rgx.replace(result, "x")
Comments
Post a Comment