showing results for - "remove non letters from a string javascript"
Fatoumata
21 Mar 2020
1// remove non-letters from a string
2function lettersOnly(str) {
3	return str.replace(/[^a-zA-Z]/g,"");
4   //or return str.match(/[a-z]/gi).join('');
5   //or return str.replace(/[^a-z]/gi,""); 
6}
7
8console.log(lettersOnly("R!=:~0o0./c&}9k`60=y"));		//"Rocky"
9console.log(lettersOnly("^,]%4B|@56a![0{2m>b1&4i4"));	//"Bambi"
10console.log(lettersOnly("^U)6$22>8p)."));				//"Up"