remove special characters from string javascript
var str = "Hello^# World/";
str.replace(/[^a-zA-Z ]/g, ""); // "Hello World"
remove special characters from string javascript
var str = "Hello^# World/";
str.replace(/[^a-zA-Z ]/g, ""); // "Hello World"
js remove special characters
var desired = stringToReplace.replace(/[^\w\s]/gi, '')
c# string remove special characters
public static string RemoveSpecialCharacters(this string str) {
StringBuilder sb = new StringBuilder();
foreach (char c in str) {
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '.' || c == '_') {
sb.Append(c);
}
}
return sb.ToString();
}
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