Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

remove non letters from a string javascript

// remove non-letters from a string
function lettersOnly(str) {
	return str.replace(/[^a-zA-Z]/g,"");
   //or return str.match(/[a-z]/gi).join('');
   //or return str.replace(/[^a-z]/gi,""); 
}

console.log(lettersOnly("R!=:~0o0./c&}9k`60=y"));		//"Rocky"
console.log(lettersOnly("^,]%4B|@56a![0{2m>b1&4i4"));	//"Bambi"
console.log(lettersOnly("^U)6$22>8p)."));				//"Up"
Comment

PREVIOUS NEXT
Code Example
Javascript :: filesaver.min.js cdn 
Javascript :: clean gradle react android 
Javascript :: google colab clicker 
Javascript :: jest cache clear 
Javascript :: get jquery version from console 
Javascript :: js random hex color 
Javascript :: jquery display none 
Javascript :: javascript got to url 
Javascript :: regular expression for numbers and comma only 
Javascript :: how to go to a link using javascript 
Javascript :: Basic JavaScript: Use Recursion to Create a Range of Numbers 
Javascript :: how to display object in alert javascript 
Javascript :: shopify json templates demo 
Javascript :: detect browser javascript 
Javascript :: javascript hex to rgb 
Javascript :: allow paste js code 
Javascript :: javascript change url without redirect 
Javascript :: google hosted jquery 
Javascript :: remove punctuation marks from string js 
Javascript :: jquery for each tr in td 
Javascript :: JS Fetch API Post Request 
Javascript :: sort array by string length javascript 
Javascript :: js go to previous page 
Javascript :: js if not undefined 
Javascript :: install latest npm for react 
Javascript :: call a function on load jquery 
Javascript :: jquery remove string from string 
Javascript :: updating node js ubuntu 
Javascript :: parse document.cookie 
Javascript :: change display javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =