aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/string/split
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/split
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/split')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/split/index.html16
1 files changed, 8 insertions, 8 deletions
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>