这种方法会导致字符串显示为下标,就好像它是在<sub>标记。
语法
下面是参数的详细信息:
返回值:
例子:
<html>
<head>
<title>JavaScript String sub() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String("Hello world");
alert(str.sub());
</script>
</body>
</html>
这将产生以下结果: