此方法由 ObjectRange 在内部使用,并将字符串的最后一个字符转换为 Unicode 字母表中的后续字符。
语法
string.sub(pattern, replacement[, count = 1]);
返回值
返回一个字符串。
例子
HTML
x
26
26
1
<html>
2
<head>
3
<title>Prototype examples</title>
4
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
5
6
<script>
7
function showResult() {
8
var str = "a";
9
alert("a.succ : " + str.succ() );
10
11
var str = "aaaa";
12
alert("aaaa.succ : " + str.succ() );
13
14
var str = "abcd";
15
alert("abcd.succ : " + str.succ() );
16
}
17
</script>
18
</head>
19
20
<body>
21
<p>Click the button to see the result.</p>
22
<br />
23
<br />
24
<input type = "button" value = "Result" onclick = "showResult();"/>
25
</body>
26
</html>
阅读剩余 78%
作者:terry,如若转载,请注明出处:https://www.web176.com/prototype_api/8828.html