let string = 'hello$@#!%%'
const specialCharacters = [
"~", "`", "!", "@",
"#", "$", "%", "^",
"&", "*", "(", ")",
"-", "_", "+", "=",
"{", "}", "[", "]",
"|", "\\", "/", ":",
";", "\"", "'", "<",
">", "?"
]
let result = string
specialCharacters.forEach(char => {
for(let i of string){
result = string.replace(char, '')
}
})
console.log(result)
Hoclaptrinh.vn © 2017
From Coder With
Unpublished comment
Viết câu trả lời