Javascript examples for String:split
Use a letter as a separator:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// w ww .j av a 2s. c o m var str = "The following code shows how to ?"; var res = str.split("o"); document.getElementById("demo").innerHTML = res; } </script> </body> </html>