aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html
diff options
context:
space:
mode:
authort7yang <t7yang@gmail.com>2022-01-10 08:38:07 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commitc40612041809fe289aba58aefa170bbe784aba1f (patch)
tree8ca89b071d04afcf7abd6d9a04d0765a041d9c8a /files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html
parent12a899ab8540bc84f56a0dc6491be80a48499d49 (diff)
downloadtranslated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.gz
translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.bz2
translated-content-c40612041809fe289aba58aefa170bbe784aba1f.zip
remove name attribute for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html12
1 files changed, 6 insertions, 6 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html
index 2fb5de2276..a21f6f1f87 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html
@@ -11,11 +11,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substr
<p><code><strong>substr()</strong></code> 方法返回一个字符串中从指定位置开始到指定字符数的字符。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><em>str</em>.substr(<em>start</em>[, <em>length</em>])</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>start</code></dt>
@@ -27,7 +27,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substr
<dd>可选。提取的字符数。</dd>
</dl>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p><code>start</code> 是一个字符的索引。首字符的索引为 0,最后一个字符的索引为 字符串的长度减去1。<code>substr</code> 从 <code>start</code> 位置开始提取字符,提取 <code>length</code> 个字符(或直到字符串的末尾)。</p>
@@ -39,7 +39,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substr
<h2 id="示例">示例</h2>
-<h3 id="Example:_Using_substr" name="Example:_Using_substr">例子:使用 <code>substr</code></h3>
+<h3 id="Example:_Using_substr">例子:使用 <code>substr</code></h3>
<pre class="brush: js">var str = "abcdefghij";
@@ -51,7 +51,7 @@ console.log("(-20, 2): " + str.substr(-20,2)); // (-20, 2): ab
console.log("(20, 2): " + str.substr(20,2)); // (20, 2):
</pre>
-<h2 id="Description" name="Description">兼容旧环境(Polyfill)</h2>
+<h2 id="Description">兼容旧环境(Polyfill)</h2>
<p>Microsoft's JScript 不支持负的 start 索引。如果你想充分利用该方法的功能,则需要使用下面的兼容性代码修复此 bug:</p>
@@ -158,7 +158,7 @@ if ('ab'.substr(-1) != 'b')
<p><strong>Note</strong>: Up to version 3.6, Firefox had a bug which caused <code>substr</code> to return empty result when an explicit <code>undefined</code> value was passed in as the <code>length</code>.</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.slice()")}}</li>