[RESOLVED]Is there a way i can make sure a string doesnt have letters in javascript ?

Hi ,

If i have 29.10.2014.r , is there a way i can make sure that all letters are replaced with a ‘ ‘ . 


'29.10.2014.r'.replace(/[a-zA-Z]+/g, '');

You can try with the below code

//Your regex value
		string regval = "[a-zA-Z]";
		//Create the Regex object
		Regex rgx = new Regex(regval);
		//your stirng value
		string strval = "29.10.2014.r";
		//Replcae the alphabets with empty space
		string result = rgx.Replace(strval, " ");

great , thanks so much 

Leave a Reply