📄 05取得字符串中指定位置的字符.htm
字号:
<html>
<head>
<title>取得字符串中指定位置的字符</title>
</head>
<body>
<script language="javascript">
<!--
str = "JavaScript";
str1 = str.charAt(0);
str2 = str.charAt(4);
document.write("str=" + str + "<br>");
document.write("第1个字符是:" + str1 + "<br>");
document.write("第5个字符是:" + str2 + "<br>");
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -