c# regex replace
Regex.Replace(
"input string", @"[a-zA-Z]+", "replace string"
);
c# regex replace
Regex.Replace(
"input string", @"[a-zA-Z]+", "replace string"
);
c# replace characters in string that are invalid using regex
string pattern = "[\~#%&*{}/:<>?|"-]";
string replacement = " ";
Regex regEx = new Regex(pattern);
string sanitized = Regex.Replace(regEx.Replace(input, replacement), @"s+", " ");
This will replace runs of whitespace with a single space as well.
c# replace regex string
string pattern = @"bwestb";
string modifiedString = Regex.Replace(input, pattern, strReplacement, RegexOptions.IgnoreCase);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us