HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Click the button to return the position where the NULL character was found in a string.</p> <button onclick="myFunction()">Click me</button> <p id="point"></p> <script> function myFunction(){ var str = "His \0style Is Who is he IS"; var pattern = /\0/; var result = str.search(pattern); document.getElementById("point").innerHTML = result; } </script> </body> </html>
OUTPUT
×

Save as Private