JavaScript String Match() Function Example

JavaScript String Match() Function check both string value are same or not.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>JavaScript str.match() function</title>
</head>
<body>
    <script type="text/javascript">
        var str="Hello Student!";
        document.write(str.match("hello student!") + "<br />");
        document.write(str.match("HELLO STUDENT!") + "<br />");
        document.write(str.match("Hello Student!") + "<br />");
        document.write(str.match("hello Student"));
    </script>
</body>
</html>

Run it...   »

Example Result