aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/string
diff options
context:
space:
mode:
authorIrvin <irvinfly@gmail.com>2022-02-16 02:03:27 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commit012ee621791b6895e637f96e6523027951768f25 (patch)
tree29cfacc0d5092af45870dcc74f22feb8b2664fbf /files/zh-cn/web/javascript/reference/global_objects/string
parentba91b017421b001cd226135612a7bd5dfcd88904 (diff)
downloadtranslated-content-012ee621791b6895e637f96e6523027951768f25.tar.gz
translated-content-012ee621791b6895e637f96e6523027951768f25.tar.bz2
translated-content-012ee621791b6895e637f96e6523027951768f25.zip
remove inline style for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/string')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/concat/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/fixed/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/length/index.html56
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/replace/index.html4
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/slice/index.html6
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/substr/index.html2
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/string/tolowercase/index.html12
7 files changed, 34 insertions, 50 deletions
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 7b53403ac2..1f2e37ceb4 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
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/concat
<p>如果参数不是字符串类型,它们在连接之前将会被转换成字符串。</p>
-<h2 id="性能" style="margin-bottom: 20px; line-height: 30px;">性能</h2>
+<h2 id="性能">性能</h2>
<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>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/fixed/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/fixed/index.html
index 28dd7c8696..6fd1d90c0d 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/fixed/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/fixed/index.html
@@ -22,7 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fixed
<h2 id="描述">描述</h2>
-<p><code style="font-size: 14px; font-style: normal; font-weight: normal; line-height: 1.5;">fixed()</code> 方法将一个字符串包裹在&lt;tt&gt;&lt;/tt&gt;标签中,比如: <code style="font-size: 14px; font-style: normal; font-weight: normal; line-height: 1.5;">"&lt;tt&gt;str&lt;/tt&gt;"</code>.</p>
+<p><code>fixed()</code> 方法将一个字符串包裹在&lt;tt&gt;&lt;/tt&gt;标签中,比如: <code>"&lt;tt&gt;str&lt;/tt&gt;"</code>.</p>
<h2 id="举例">举例</h2>
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 9ec301ff64..bf49c313f0 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" style="margin-bottom: 20px; line-height: 30px;">概述</h2>
+<h2 id="Summary" name="Summary">概述</h2>
<p><strong>length</strong> 属性表示一个字符串的长度。</p>
-<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2>
+<h2 id="Description" name="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" style="margin-bottom: 20px; line-height: 30px;">示例</h2>
+<h2 id="Examples" name="Examples">示例</h2>
<pre class="brush: js">var x = "Mozilla";
var empty = "";
@@ -33,23 +33,7 @@ console.log("Mozilla is " + x.length + " code units long");
console.log("The empty string is has a length of " + empty.length);
/* "The empty string is has a length of 0" */</pre>
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 19px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 38px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 57px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 76px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 95px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 114px; background: 0px 0px;"> </div>
-
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 133px; background: 0px 0px;"> </div>
-
-<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
+<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
@@ -76,7 +60,7 @@ console.log("The empty string is has a length of " + empty.length);
</tbody>
</table>
-<h2 id="浏览器兼容性" style="margin-bottom: 20px; line-height: 30px;">浏览器兼容性</h2>
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p>{{ CompatibilityTable() }}</p>
@@ -84,12 +68,12 @@ console.log("The empty string is has a length of " + empty.length);
<table class="compat-table">
<tbody>
<tr>
- <th style="line-height: 16px;">Feature</th>
- <th style="line-height: 16px;">Chrome</th>
- <th style="line-height: 16px;">Firefox (Gecko)</th>
- <th style="line-height: 16px;">Internet Explorer</th>
- <th style="line-height: 16px;">Opera</th>
- <th style="line-height: 16px;">Safari</th>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
@@ -107,13 +91,13 @@ console.log("The empty string is has a length of " + empty.length);
<table class="compat-table">
<tbody>
<tr>
- <th style="line-height: 16px;">Feature</th>
- <th style="line-height: 16px;">Android</th>
- <th style="line-height: 16px;">Chrome for Android</th>
- <th style="line-height: 16px;">Firefox Mobile (Gecko)</th>
- <th style="line-height: 16px;">IE Mobile</th>
- <th style="line-height: 16px;">Opera Mobile</th>
- <th style="line-height: 16px;">Safari Mobile</th>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
@@ -128,8 +112,8 @@ console.log("The empty string is has a length of " + empty.length);
</table>
</div>
-<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2>
+<h2 id="See_also" name="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" style="white-space: pre-line;">JavaScript String.length and Internationalizing Web Applications</a></li>
+ <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>
</ul>
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 5991e8fa0a..e5930019f1 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
@@ -82,13 +82,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replace
<td>插入当前匹配的子串右边的内容。</td>
</tr>
<tr>
- <td style="white-space: nowrap;"><code>$<em>n</em></code></td>
+ <td><code>$<em>n</em></code></td>
<td>
<p>假如第一个参数是 {{jsxref("RegExp")}}对象,并且 n 是个小于100的非负整数,那么插入第 n 个括号匹配的字符串。提示:索引是从1开始。如果不存在第 n个分组,那么将会把匹配到到内容替换为字面量。比如不存在第3个分组,就会用“$3”替换匹配到的内容。</p>
</td>
</tr>
<tr>
- <td style="white-space: nowrap;"><code><em>$&lt;Name&gt;</em></code></td>
+ <td><code><em>$&lt;Name&gt;</em></code></td>
<td> 这里<em><code>Name</code></em> 是一个分组名称。如果在正则表达式中并不存在分组(或者没有匹配),这个变量将被处理为空字符串。只有在支持命名分组捕获的浏览器中才能使用。</td>
</tr>
</tbody>
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 35f5dd5736..b64952f80e 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
@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/slice
<dt><code>beginIndex</code></dt>
<dd>从该索引(以 0 为基数)处开始提取原字符串中的字符。如果值为负数,会被当做 <code>strLength + beginIndex</code> 看待,这里的<code>strLength</code> 是字符串的长度(例如, 如果 <code>beginIndex</code> 是 -3 则看作是:<code>strLength - 3</code>)</dd>
<dt><code>endIndex</code></dt>
- <dd>可选。在该索引(以 0 为基数)处结束提取字符串。如果省略该参数,<code style="font-style: normal;">slice()</code> 会一直提取到字符串末尾。如果该参数为负数,则被看作是 strLength + endIndex,这里的 strLength 就是字符串的长度(例如,如果 endIndex 是 -3,则是, strLength - 3)。</dd>
+ <dd>可选。在该索引(以 0 为基数)处结束提取字符串。如果省略该参数,<code>slice()</code> 会一直提取到字符串末尾。如果该参数为负数,则被看作是 strLength + endIndex,这里的 strLength 就是字符串的长度(例如,如果 endIndex 是 -3,则是, strLength - 3)。</dd>
</dl>
<h3 id="返回值">返回值</h3>
@@ -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" style="margin-bottom: 20px; font-size: 2.14285714285714rem;">例子</h2>
+<h2 id="Examples" name="Examples">例子</h2>
<h3 id="使用_slice()_创建一个新的字符串">使用 <code>slice()</code> 创建一个新的字符串</h3>
@@ -73,7 +73,7 @@ str.slice(-3, -1); // 返回 'us'
str.slice(0, -1); // 返回 'The morning is upon us'
</pre>
-<h2 id="规范" style="margin-bottom: 20px; font-size: 2.14285714285714rem;">规范</h2>
+<h2 id="规范">规范</h2>
<table class="standard-table">
<thead>
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 2aad2f2647..2fb5de2276 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
@@ -19,7 +19,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substr
<dl>
<dt><code>start</code></dt>
- <dd>开始提取字符的位置。如果为负值,则被看作 <code style="font-style: normal; line-height: 1.5;">strLength + </code><code style="font-style: normal; line-height: 1.5;">start,其中</code> <code style="font-style: normal; line-height: 1.5;">strLength</code> 为字符串的长度(例如,如果 <code>start</code> 为 <code>-3,则被看作</code> <code>strLength + (-3))。</code></dd>
+ <dd>开始提取字符的位置。如果为负值,则被看作 <code>strLength + </code><code>start,其中</code> <code>strLength</code> 为字符串的长度(例如,如果 <code>start</code> 为 <code>-3,则被看作</code> <code>strLength + (-3))。</code></dd>
</dl>
<dl>
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/tolowercase/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/tolowercase/index.html
index f556822b2e..7db9f1e146 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/string/tolowercase/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/string/tolowercase/index.html
@@ -13,22 +13,22 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase
<p><code><strong>toLowerCase()</strong></code> 会将调用该方法的字符串值转为小写形式,并返回。</p>
-<h2 id="语法" style="margin-bottom: 20px; line-height: 30px;">语法</h2>
+<h2 id="语法">语法</h2>
-<pre class="syntaxbox language-html" style="margin-bottom: 0px; padding: 1em; border-left-width: 6px; border-left-style: solid; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 14px; direction: ltr; white-space: normal; text-shadow: none; background-color: rgba(212, 221, 228, 0.498039);"><code class="language-html" style="font-family: Consolas, Monaco, 'Andale Mono', monospace; direction: ltr; color: inherit; text-shadow: none;">str.toLowerCase()</code>
+<pre class="syntaxbox language-html"><code class="language-html">str.toLowerCase()</code>
</pre>
<h3 id="返回值">返回值</h3>
<p>一个新的字符串,表示转换为小写的调用字符串。</p>
-<h2 id="描述" style="margin-bottom: 20px; line-height: 30px;">描述</h2>
+<h2 id="描述">描述</h2>
<p><code>toLowerCase</code> 会将调用该方法的字符串值转为小写形式,并返回。<code>toLowerCase</code> 不会影响字符串本身的值。</p>
-<h2 id="示例" style="margin-bottom: 20px; line-height: 30px;">示例</h2>
+<h2 id="示例">示例</h2>
-<h3 id="例子:使用_toLowerCase" style="line-height: 24px;">例子:使用 <code>toLowerCase()</code></h3>
+<h3 id="例子:使用_toLowerCase">例子:使用 <code>toLowerCase()</code></h3>
<pre class="brush: js">console.log('中文简体 zh-CN || zh-Hans'.toLowerCase());
// 中文简体 zh-cn || zh-hans
@@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase
​console.log( "ALPHABET".toLowerCase() );
// "alphabet"</pre>
-<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"></div>
+<div class="line-number"></div>
<p><strong>说明</strong></p>