JavaScript Reference/Javascript Methods/substr
Версия от 18:30, 25 мая 2010; (обсуждение)
"substr()" Example
<html>
<body>
<button onclick="var myS = new String("Sample String");
alert(myS.substr(4,7));">
sub string</button>
</body>
</html>
"substr()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |String |
+----------------+--------------------------------------------------------------+
"substr()" Syntax Parameters and Note
Note:
Get string"s sub string.
Syntax:
stringName.substr(param1, param2)
Parameters:
param1 Required; the character number.
param2 Required; the length of the subset string.