运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到空间
<!DOCTYPE html> <html> <body> <h1>JavaScript Strings</h1> <h2>The split() Method</h2> <p>split() splits a string into an array of substrings, and returns the array.</p> <p>The second character is:</p> <p id="demo"></p> <script> let text = "How are you doing today?"; const chars = text.split(""); document.getElementById("demo").innerHTML = chars[1]; </script> </body> </html>