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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -