aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/string
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/string')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/anchor/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/charat/index.html14
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/charcodeat/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/concat/index.html10
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/fromcharcode/index.html8
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/index.html18
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/indexof/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/lastindexof/index.html12
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/length/index.html8
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/link/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/match/index.html16
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html8
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/replace/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/slice/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/split/index.html16
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html12
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/substring/index.html14
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html12
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/trimend/index.html8
20 files changed, 87 insertions, 87 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/anchor/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/anchor/index.html
index b48e62e0f8..43ab947d68 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/anchor/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/anchor/index.html
@@ -129,7 +129,7 @@ document.body.innerHTML = myString.anchor("contents_anchor");</pre>
<p>从{{gecko("17")}}开始  <strong>"</strong> (引号) 被 HTML引用字符 <code>&amp;quot所替代</code>;在字符串中申请<code>命名参数</code>.</p>
-<h2 id="See_Also" name="See_Also">相关链接</h2>
+<h2 id="See_Also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.link()")}}</li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/charat/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/charat/index.html
index 31b512ada0..ab72e58c81 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/charat/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/charat/index.html
@@ -7,15 +7,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/charAt
---
<p>{{JSRef}}</p>
-<h2 id="Summary" name="Summary">概述</h2>
+<h2 id="Summary">概述</h2>
<p><strong>charAt()</strong> 方法从一个字符串中返回指定的字符。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><em>str</em>.charAt(<em>index</em>)</pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>index</code></dt>
@@ -24,13 +24,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/charAt
<dt> </dt>
</dl>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>字符串中的字符从左向右索引,第一个字符的索引值为 0,最后一个字符(假设该字符位于字符串 stringName 中)的索引值为 <code>stringName.length - 1</code>。 如果指定的 index 值超出了该范围,则返回一个空字符串。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example:_Displaying_characters_at_different_locations_in_a_string" name="Example:_Displaying_characters_at_different_locations_in_a_string">例子:输出字符串中不同位置的字符</h3>
+<h3 id="Example:_Displaying_characters_at_different_locations_in_a_string">例子:输出字符串中不同位置的字符</h3>
<p>下例输出字符串 "<code>Brave new world</code>" 不同位置处的字符:</p>
@@ -269,7 +269,7 @@ function getWholeCharAndI (str, i) {
</table>
</div>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.indexOf()")}}, {{jsxref("String.prototype.lastIndexOf()")}}</li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/charcodeat/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/charcodeat/index.html
index e0c7b1168f..ad5bd693df 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/charcodeat/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/charcodeat/index.html
@@ -49,9 +49,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/charCodeAt
<p>向后兼容:在历史版本中(如 JavaScript 1.2),<code>charCodeAt</code> 返回一个数字,表示给定 index 处字符的 ISO-Latin-1 编码值。ISO-Latin-1 编码集范围从 <code>0</code> 到 <code>255</code>。开头的 <code>0</code> 到 <code>127</code> 直接匹配 ASCII 字符集。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example_Using_charCodeAt" name="Example:_Using_charCodeAt">使用 <code>charCodeAt()</code></h3>
+<h3 id="Example_Using_charCodeAt">使用 <code>charCodeAt()</code></h3>
<p>下例介绍了不同索引情况下返回的 Unicode 值:</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/concat/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/concat/index.html
index 1f2e37ceb4..09efff146b 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/concat/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/concat/index.html
@@ -12,11 +12,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/concat
<p><strong><code>concat()</code></strong> 方法将一个或多个字符串与原字符串连接合并,形成一个新的字符串并返回。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre><code><var>str</var>.concat(<var>str2</var>, [, ...<var>strN</var>])</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code><var>str2</var> [, ...<var>strN</var>]</code></dt>
@@ -27,7 +27,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/concat
<p>一个新的字符串,包含参数所提供的连接字符串。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p><code>concat</code> 方法将一个或多个字符串与原字符串连接合并,形成一个新的字符串并返回。 <code>concat</code> 方法并不影响原字符串。</p>
@@ -37,9 +37,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/concat
<p>强烈建议使用<a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Assignment_Operators">赋值操作符</a>(<code>+</code>, <code>+=</code>)代替 <code>concat</code> 方法。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Examples" name="Examples">使用 <code>concat</code></h3>
+<h3 id="Examples">使用 <code>concat</code></h3>
<p>下面的例子演示如何将多个字符串与原字符串合并为一个新字符串</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/fromcharcode/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/fromcharcode/index.html
index 3ac0a6a122..99e3827daa 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/fromcharcode/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/fromcharcode/index.html
@@ -14,11 +14,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCharCode
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code>String.fromCharCode(<var>num1</var>[, ...[, <var>numN</var>]])</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>num1, ..., num<em>N</em></code></dt>
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCharCode
<p>一个长度为 <code>N</code> 的字符串,由 <code>N</code> 个指定的 UTF-16 代码单元组成。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>该方法返回一个字符串,而不是一个  {{jsxref("String")}} 对象。</p>
@@ -81,7 +81,7 @@ String.fromCharCode(0xD834, 0xDF06, 0x61, 0xD834, 0xDF07); // "\uD834\uDF06a\uD8
<p>{{Compat("javascript.builtins.String.fromCharCode")}}</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.charCodeAt()")}}</li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html
index 672a34166f..6784bfb61f 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html
@@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/includes
<p><strong><code>includes()</code> </strong>方法用于判断一个字符串是否包含在另一个字符串中,根据情况返回 true 或 false。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><var>str</var>.includes(<var>searchString</var>[, <var>position</var>])</pre>
@@ -60,7 +60,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/includes
};
}</code></pre>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<h3 id="使用_includes">使用 includes()</h3>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/index.html
index bcfc0bf5ec..6b8d96b0ac 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/index.html
@@ -12,7 +12,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String
<p><strong><code>String</code></strong> 全局对象是一个用于字符串或一个字符序列的构造函数。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<p>字符串字面量采取以下形式:</p>
@@ -35,20 +35,20 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String
<pre class="syntaxbox">String(thing)
new String(thing)</pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>thing</code></dt>
<dd>任何可以被转换成字符串的值。</dd>
</dl>
-<h3 id="Parameters" name="Parameters">模板字面量</h3>
+<h3 id="Parameters">模板字面量</h3>
<p>从 ECMAScript 2015 开始,字符串字面量也可以称为<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals">模板字面量</a>:</p>
<pre>`hello world` `hello! world!` `hello ${who}` escape `&lt;a&gt;${who}&lt;/a&gt;`</pre>
-<h3 id="Parameters" name="Parameters">转义字符</h3>
+<h3 id="Parameters">转义字符</h3>
<dl>
</dl>
@@ -141,11 +141,11 @@ otherwise my code is unreadable.";</code></pre>
<dl>
</dl>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>字符串对于保存可以以文本形式表示的数据非常有用。 一些常用的字符串操作有:查询<a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/length">字符串长度</a>,使用<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/String_Operators"> + 和 += </a>运算符来构建和连接字符串,使用 <a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf">indexOf</a> 方法检查某一子字符串在父字符串中的位置,又或是使用 <a href="/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/substring">substring</a> 方法提取从父字符串中提取子字符串。</p>
-<h3 id="Character_access" name="Character_access">从字符串中获取单个字符</h3>
+<h3 id="Character_access">从字符串中获取单个字符</h3>
<p>获取字符串的某个字符有两种方法。 第一种是使用 {{jsxref("String.charAt", "charAt")}} 方法:</p>
@@ -159,7 +159,7 @@ otherwise my code is unreadable.";</code></pre>
<p>使用括号访问字符串不可以对其进行删除或添加,因为字符串对应未知的属性并不是可读或配置的。 (更多的信息请参阅 {{jsxref("Object.defineProperty")}}。 )</p>
-<h3 id="Comparing_strings" name="Comparing_strings">字符串比较</h3>
+<h3 id="Comparing_strings">字符串比较</h3>
<p>熟练使用 C 语言的开发者经常使用 <code>strcmp</code> 函数来比较字符串,但在 JavaScript 中,你只需要使用<a href="/zh-CN/docs/Web/JavaScript/Reference/Operators/Comparison_Operators">比较操作符(&gt;/&lt;/&gt;=/&lt;=)</a>:</p>
@@ -212,7 +212,7 @@ console.log(eval(s2)); // returns the string "2 + 2"
<dd>可以为 String 对象增加新的属性。</dd>
</dl>
-<h2 id="Methods" name="Methods">方法</h2>
+<h2 id="Methods">方法</h2>
<dl>
<dt>{{jsxref("String.fromCharCode()")}}  </dt>
@@ -247,7 +247,7 @@ console.log(String.replace(num, /5/, '2'));
<p class="brush: js">{{jsxref("Global_Objects/Array", "Generics", "#Array_generic_methods", 1)}} 在 Javascript 1.6 中同样支持{{jsxref("Global_Objects/Array", "Array")}}。</p>
-<h2 id="String_instances" name="String_instances"><code>String</code> 实例</h2>
+<h2 id="String_instances"><code>String</code> 实例</h2>
<h3 id="属性_2">属性</h3>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/indexof/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/indexof/index.html
index 28f9d9a5fc..40fceeeadd 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/indexof/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/indexof/index.html
@@ -84,7 +84,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/indexOf
<h2 id="示例">示例</h2>
-<h3 id="Example_Using_indexOf_and_lastIndexOf" name="Example:_Using_indexOf_and_lastIndexOf">使用<code>indexOf()</code> 和 <code>lastIndexOf()</code></h3>
+<h3 id="Example_Using_indexOf_and_lastIndexOf">使用<code>indexOf()</code> 和 <code>lastIndexOf()</code></h3>
<p>下例使用 <code>indexOf()</code> 和 <code>lastIndexOf()</code> 方法定位字符串中 "<code>Brave new world</code>" 的值。</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/lastindexof/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/lastindexof/index.html
index 56ba74598a..297d9f6d89 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/lastindexof/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/lastindexof/index.html
@@ -9,11 +9,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
<p>该方法将从尾到头地检索字符串 <em>str</em>,看它是否含有子串 <em>searchValue</em>。开始检索的位置在字符串的 <em>fromIndex</em> 处或字符串的结尾(没有指定 <em>fromIndex</em> 时)。如果找到一个 <em>searchValue</em>,则返回 <em>searchValue</em> 的第一个字符在 <em>str</em> 中的位置。<em>str</em>中的字符位置是从 0 开始的。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><em>str</em>.lastIndexOf(<em>searchValue</em>[, fromIndex])</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>searchValue</code></dt>
@@ -27,7 +27,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
<p>返回指定值最后一次出现的索引(该索引仍是以从左至右0开始记数的),如果没找到则返回-1。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>字符串中的字符被从左向右索引。首字符的索引(index)是 0,最后一个字符的索引是 <code>stringName.length - 1</code>。</p>
@@ -47,15 +47,15 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
<p>(例如'abadefgabm'.lastIndexOf('ab', 7) 返回7,虽然查找的'ab'中的b已经在 index=8的位置了从index=7的a处向左查找仍是能找到自身a加上其后连成ab,因为fromIndex指的是待匹配字符串的开头那一个)</p>
-<h3 id="Example_indexOf_and_case-sensitivity" name="Example:_indexOf_and_case-sensitivity">区分大小写</h3>
+<h3 id="Example_indexOf_and_case-sensitivity">区分大小写</h3>
<p><code>lastIndexOf</code> 方法区分大小写。例如,下面的表达式返回 -1:</p>
<pre class="brush:js">"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1</pre>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example_Using_indexOf_and_lastIndexOf" name="Example:_Using_indexOf_and_lastIndexOf">例子:使用 <code>indexOf</code> 和 <code>lastIndexOf</code></h3>
+<h3 id="Example_Using_indexOf_and_lastIndexOf">例子:使用 <code>indexOf</code> 和 <code>lastIndexOf</code></h3>
<p>下例使用 <code>indexOf</code> 和 <code>lastIndexOf</code> 方法来定位字符串 "<code>Brave new world</code>" 中的值。</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/length/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/length/index.html
index bf49c313f0..afef2dd204 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/length/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/length/index.html
@@ -10,11 +10,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/length
---
<p>{{JSRef("Global_Objects", "String")}}</p>
-<h2 id="Summary" name="Summary">概述</h2>
+<h2 id="Summary">概述</h2>
<p><strong>length</strong> 属性表示一个字符串的长度。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>该属性返回字符串中字符编码单元的数量。JavaScript 使用 {{ interwiki("wikipedia", "UTF-16") }} 编码,该编码使用一个 16 比特的编码单元来表示大部分常见的字符,使用两个代码单元表示不常用的字符。因此 length 返回值可能与字符串中实际的字符数量不相同。</p>
@@ -22,7 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/length
<p>静态属性 <strong>String.length</strong> 返回 1。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<pre class="brush: js">var x = "Mozilla";
var empty = "";
@@ -112,7 +112,7 @@ console.log("The empty string is has a length of " + empty.length);
</table>
</div>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li><a class="external external-icon" href="http://developer.teradata.com/blog/jasonstrimpel/2011/11/javascript-string-length-and-internationalizing-web-applications">JavaScript String.length and Internationalizing Web Applications</a></li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/link/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/link/index.html
index ed9faa514e..2ca4055211 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/link/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/link/index.html
@@ -28,7 +28,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/link
<p>使用 <code>link</code> 方法创建的链接将会成为 document.links 数组中的元素。查看 {{ Domxref("document.links") }}。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<h3 id="例子:使用_link">例子:使用 <code>link</code></h3>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html
index f369a7a7f9..57bd74a182 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/match/index.html
@@ -10,11 +10,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match
<div>{{EmbedInteractiveExample("pages/js/string-match.html", "shorter")}}</div>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><em>str</em>.match(regexp)</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>regexp</code></dt>
@@ -42,11 +42,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match
<dd>一个{{jsxref("Array")}},其内容取决于global(<code>g</code>)标志的存在与否,如果未找到匹配则为{{jsxref("null")}}。</dd>
</dl>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>如果正则表达式不包含 <code>g </code>标志,<code>str.match()</code> 将返回与 {{jsxref("RegExp.prototype.exec()", "RegExp.exec()")}}. 相同的结果。</p>
-<h3 id="Notes" name="Notes">参看:<code>RegExp</code> 方法</h3>
+<h3 id="Notes">参看:<code>RegExp</code> 方法</h3>
<ul>
<li>如果你需要知道一个字符串是否与一个正则表达式匹配 {{jsxref("RegExp")}} ,可使用 {{jsxref("RegExp.prototype.test()", "RegExp.test()")}} 。</li>
@@ -54,9 +54,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match
<li>如果你想要获得捕获组,并且设置了全局标志,你需要用 {{jsxref("RegExp.prototype.exec()", "RegExp.exec()")}}  或者 {{jsxref("String.prototype.matchAll()", " String.prototype.matchAll()")}}</li>
</ul>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example_Using_match" name="Example:_Using_match">例子:使用 <code>match</code></h3>
+<h3 id="Example_Using_match">例子:使用 <code>match</code></h3>
<p>在下例中,使用 <code>match</code> 查找 "<code>Chapter</code>" 紧跟着 1 个或多个数值字符,再紧跟着一个小数点和数值字符 0 次或多次。正则表达式包含 <code>i</code> 标志,因此大小写会被忽略。</p>
@@ -78,7 +78,7 @@ console.log(found);
// 'index' 属性(22) 是整个匹配从零开始的索引。
// 'input' 属性是被解析的原始字符串。</pre>
-<h3 id="Example_Using_global_and_ignore_case_flags_with_match" name="Example:_Using_global_and_ignore_case_flags_with_match">例子:<code>match</code> 使用全局(global)和忽略大小写(ignore case)标志</h3>
+<h3 id="Example_Using_global_and_ignore_case_flags_with_match">例子:<code>match</code> 使用全局(global)和忽略大小写(ignore case)标志</h3>
<p>下例展示了 <code>match</code> 使用 global 和 ignore case 标志。A-E、a-e 的所有字母将会作为一个数组的元素返回。</p>
@@ -204,7 +204,7 @@ str3.match(null); // 返回["null"]</pre>
<li>从 Gecko 49 {{geckoRelease(49)}} 开始 , 不再支持非标准的标志参数 ({{bug(1108382)}}).</li>
</ul>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("RegExp")}}</li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html
index e412b0da5c..45ea5be584 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/repeat/index.html
@@ -18,11 +18,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat
<p><strong><code>repeat()</code></strong> 构造并返回一个新字符串,该字符串包含被连接在一起的指定数量的字符串的副本。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><var>str</var>.repeat(<var>count</var>)</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>count</code></dt>
@@ -86,7 +86,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat
}</pre>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<pre class="brush:js">"abc".repeat(-1) // RangeError: repeat count must be positive and less than inifinity
"abc".repeat(0) // ""
@@ -113,7 +113,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat
</tbody>
</table>
-<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
+<h2 id="Browser_compatibility">浏览器兼容性</h2>
<p>{{Compat("javascript.builtins.String.repeat")}}</p>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/replace/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/replace/index.html
index e5930019f1..5e75b81d05 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/replace/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/replace/index.html
@@ -145,7 +145,7 @@ var newString = 'abc12345#$*%'.replace(/([^\d]*)(\d*)([^\w]*)/, replacer);
console.log(newString); // abc - 12345 - #$*%
</pre>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<h3 id="在_replace_中使用正则表达式">在 <code>replace()</code> 中使用正则表达式</h3>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/slice/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/slice/index.html
index b64952f80e..29e58c07a8 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/slice/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/slice/index.html
@@ -46,7 +46,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/slice
<p>例 2:<code>str.slice(2, -1)</code> 提取第三个字符到倒数第一个字符。</p>
-<h2 id="Examples" name="Examples">例子</h2>
+<h2 id="Examples">例子</h2>
<h3 id="使用_slice()_创建一个新的字符串">使用 <code>slice()</code> 创建一个新的字符串</h3>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/split/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/split/index.html
index c1dee44c87..75ba2c0748 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/split/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/split/index.html
@@ -18,7 +18,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/split
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><em>str.split([separator[, limit]])</em></code>
</pre>
@@ -40,7 +40,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/split
<p>返回源字符串以分隔符出现位置分隔而成的一个 {{jsxref("Array")}} </p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p>找到分隔符后,将其从字符串中删除,并将子字符串的数组返回。如果没有找到或者省略了分隔符,则该数组包含一个由整个字符串组成的元素。如果分隔符为空字符串,则将str转换为字符数组。如果分隔符出现在字符串的开始或结尾,或两者都分开,分别以空字符串开头,结尾或两者开始和结束。因此,如果字符串仅由一个分隔符实例组成,则该数组由两个空字符串组成。</p>
@@ -48,9 +48,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/split
<p>{{Note("当字符串为空时,split()返回一个包含一个空字符串的数组,而不是一个空数组,如果字符串和分隔符都是空字符串,则返回一个空数组。")}}</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example_Using_split" name="Example:_Using_split">使用 <code>split()</code></h3>
+<h3 id="Example_Using_split">使用 <code>split()</code></h3>
<p>下例定义了一个函数:根据指定的分隔符将一个字符串分割成一个字符串数组。分隔字符串后,该函数依次输出原始字符串信息,被使用的分隔符,返回数组元素的个数,以及返回数组中所有的元素。</p>
@@ -91,7 +91,7 @@ The separator is: ","
The array has 12 elements: Jan / Feb / Mar / Apr / May / Jun / Jul / Aug / Sep / Oct / Nov / Dec /
</pre>
-<h3 id="Example_Removing_spaces_from_a_string" name="Example:_Removing_spaces_from_a_string">移出字符串中的空格</h3>
+<h3 id="Example_Removing_spaces_from_a_string">移出字符串中的空格</h3>
<p>下例中,<code>split()</code> 方法会查找“0 或多个空白符接着的分号,再接着 0 或多个空白符”模式的字符串,找到后,就将空白符从字符串中移除,<code>nameList</code> 是 <code>split</code> 的返回数组。</p>
@@ -111,7 +111,7 @@ console.log(nameList);
[ "Harry Trump", "Fred Barney", "Helen Rigby", "Bill Abel", "Chris Hand", "" ]</code>
</pre>
-<h3 id="Example_Returning_a_limited_number_of_splits" name="Example:_Returning_a_limited_number_of_splits">限制返回值中分割元素数量</h3>
+<h3 id="Example_Returning_a_limited_number_of_splits">限制返回值中分割元素数量</h3>
<p>下例中,<code>split</code> 查找字符串中的 0 或多个空格,并返回找到的前 3 个分割元素(splits)。</p>
@@ -125,7 +125,7 @@ console.log(splits);
<pre><code>["Hello", "World.", "How"]</code></pre>
-<h3 id="Example_Capturing_parentheses" name="Example:_Capturing_parentheses">靠正则来分割使结果中包含分隔块</h3>
+<h3 id="Example_Capturing_parentheses">靠正则来分割使结果中包含分隔块</h3>
<p>如果 <code>separator</code> 包含捕获括号(capturing parentheses),则其匹配结果将会包含在返回的数组中。</p>
@@ -203,7 +203,7 @@ const strReverse = str.split(/(?:)/u).reverse().join('');
<p>{{Compat("javascript.builtins.String.split")}}</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.charAt()")}}</li>
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>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/substring/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/substring/index.html
index 445b0dfea5..6aef7ea138 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/substring/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/substring/index.html
@@ -9,11 +9,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substring
<p><strong><code>substring() </code></strong>方法返回一个字符串在开始索引到结束索引之间的一个子集, 或从开始索引直到字符串的末尾的一个子集。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><var>str</var>.substring(<var>indexStart</var>[, <var>indexEnd</var>])</code></pre>
-<h3 id="Parameters" name="Parameters">参数</h3>
+<h3 id="Parameters">参数</h3>
<dl>
<dt><code>indexStart</code></dt>
@@ -26,7 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substring
<p>包含给定字符串的指定部分的新字符串。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p><code>substring</code> 提取从 <code>indexStart</code> 到 <code>indexEnd</code>(不包括)之间的字符。特别地:</p>
@@ -38,9 +38,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substring
<li>如果 <code>indexStart</code> 大于 <code>indexEnd</code>,则 <code>substring</code> 的执行效果就像两个参数调换了一样。见下面的例子。</li>
</ul>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example_Using_substring" name="Example:_Using_substring">例子:使用 <code>substring</code></h3>
+<h3 id="Example_Using_substring">例子:使用 <code>substring</code></h3>
<p>下例使用 <code>substring</code> 输出字符串 "<code>Mozilla</code>" 中的字符:</p>
@@ -83,7 +83,7 @@ var anyString = 'Mozilla';
var anyString5 = anyString.substring(anyString.length - 5);
console.log(anyString5);</pre>
-<h3 id="Example_Replacing_a_substring_within_a_string" name="Example:_Replacing_a_substring_within_a_string">例子:替换一个字符串的子字符串</h3>
+<h3 id="Example_Replacing_a_substring_within_a_string">例子:替换一个字符串的子字符串</h3>
<p>下例替换了一个字符串中的子字符串。可以替换单个字符和子字符串。该例结尾调用的函数将 "<code>Brave New World</code>" 变成了 "<code>Brave New Web</code>"。</p>
@@ -186,7 +186,7 @@ replaceString("World", "Web", "Brave New World");</pre>
</table>
</div>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.substr()")}}</li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html
index f8f9d021da..ff09cb22b0 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/tostring/index.html
@@ -5,11 +5,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toString
---
<div>{{JSRef("Global_Objects", "String")}}</div>
-<h2 id="Summary" name="Summary">概述</h2>
+<h2 id="Summary">概述</h2>
<p><code><strong>toString()</strong></code> 方法返回指定对象的字符串形式。</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><em>str</em>.toString()</code>
</pre>
@@ -18,13 +18,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toString
<p>一个表示调用对象的字符串。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p><code>String</code> 对象覆盖了{{jsxref("Global_Objects/Object", "Object")}} 对象的 <code>toString</code> 方法;并没有继承 {{jsxref("Object.toString()")}}。对于 <code>String</code> 对象,<code>toString</code> 方法返回该对象的字符串形式,和 {{jsxref("String.prototype.valueOf()")}} 方法返回值一样。</p>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
-<h3 id="Example_Using_toString" name="Example:_Using_toString">例子:使用 <code>toString</code></h3>
+<h3 id="Example_Using_toString">例子:使用 <code>toString</code></h3>
<p>下例输出一个字符串对象(String object)的字符串值:</p>
@@ -116,7 +116,7 @@ alert(x.toString()) // 输出 "Hello world"</pre>
</table>
</div>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("Object.prototype.toSource()")}}</li>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/trimend/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/trimend/index.html
index a3422659aa..1edf0d9200 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/trimend/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/trimend/index.html
@@ -17,7 +17,7 @@ original_slug: Web/JavaScript/Reference/Global_Objects/String/TrimRight
<p>The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
-<h2 id="Syntax" name="Syntax">语法</h2>
+<h2 id="Syntax">语法</h2>
<pre class="syntaxbox"><code><var>str</var>.trimEnd();
<var>str</var>.trimRight();</code></pre>
@@ -26,7 +26,7 @@ original_slug: Web/JavaScript/Reference/Global_Objects/String/TrimRight
<p>一个新字符串,表示从调用字串的末(右)端除去空白。</p>
-<h2 id="Description" name="Description">描述</h2>
+<h2 id="Description">描述</h2>
<p><code>trimEnd()</code> / <code>trimRight()</code>方法移除原字符串右端的连续空白符并返回,<code>trimEnd()</code> / <code>trimRight()</code>方法并不会直接修改原字符串本身。</p>
@@ -37,7 +37,7 @@ original_slug: Web/JavaScript/Reference/Global_Objects/String/TrimRight
<pre class="brush: js"><code>String.prototype.trimRight.name === "trimEnd";</code>
</pre>
-<h2 id="Examples" name="Examples">示例</h2>
+<h2 id="Examples">示例</h2>
<h3 id="使用trimEnd">使用<code>trimEnd()</code></h3>
@@ -77,7 +77,7 @@ console.log(str); // ' foo'
<p>{{Compat("javascript.builtins.String.trimEnd")}}</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
+<h2 id="See_also">相关链接</h2>
<ul>
<li>{{jsxref("String.prototype.trim()")}}</li>