Gayathri Srinivasan edited untitled.tex  over 8 years ago

Commit id: 27ff30a0313845bd7b2f744ecc0e993d15004b15

deletions | additions      

       

console.log(myString.lastIndexOf('r'));  //output: 11  \subsubsection{Match():}  Executes a search for a match within a string based on a regular expression. It returns an array of information or null if no match is found.  //match(regexp) //select integers only  var intRegex = /[0-9 -()+]+$/;   var myNumber = '999';  var myInt = myNumber.match(intRegex);  console.log(isInt);  //output: 999  var myString = '999 JS Coders';  var myInt = myString.match(intRegex);  console.log(isInt);  //output: null