The use of regular expressions will be more useful in this case.
In Regular expression,
^is used to match start,$is to match end &\sis to match whitespace (newline, tab, space etc.).
function getTheExactStrings(myarray, myname) {
// Write a regular expression as per your need…
Top comments (0)