From d44f5032d0f53256b2d5aef505d6b593fd3cd158 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:14:18 +0800 Subject: fix yari h2m dry run errors (zh-CN) --- .../global_objects/string/@@iterator/index.html | 52 +--------------- .../global_objects/string/anchor/index.html | 59 +----------------- .../reference/global_objects/string/big/index.html | 52 +--------------- .../global_objects/string/blink/index.html | 50 +-------------- .../global_objects/string/bold/index.html | 50 +-------------- .../global_objects/string/charat/index.html | 50 +-------------- .../global_objects/string/charcodeat/index.html | 4 +- .../global_objects/string/codepointat/index.html | 50 +-------------- .../global_objects/string/fixed/index.html | 50 +-------------- .../global_objects/string/fontcolor/index.html | 56 +---------------- .../global_objects/string/fontsize/index.html | 52 +--------------- .../global_objects/string/fromcodepoint/index.html | 9 ++- .../global_objects/string/includes/index.html | 7 +-- .../reference/global_objects/string/index.html | 60 ++---------------- .../global_objects/string/indexof/index.html | 4 +- .../global_objects/string/italics/index.html | 52 +--------------- .../global_objects/string/lastindexof/index.html | 59 ++---------------- .../global_objects/string/length/index.html | 50 +-------------- .../global_objects/string/match/index.html | 71 ++-------------------- .../global_objects/string/matchall/index.html | 4 +- .../global_objects/string/padstart/index.html | 4 +- .../global_objects/string/repeat/index.html | 2 +- .../global_objects/string/replace/index.html | 8 +-- .../global_objects/string/replaceall/index.html | 12 ++-- .../global_objects/string/small/index.html | 50 +-------------- .../global_objects/string/split/index.html | 8 +-- .../global_objects/string/strike/index.html | 50 +-------------- .../reference/global_objects/string/sub/index.html | 50 +-------------- .../global_objects/string/substr/index.html | 54 +--------------- .../global_objects/string/substring/index.html | 50 +-------------- .../reference/global_objects/string/sup/index.html | 50 +-------------- .../string/tolocalelowercase/index.html | 50 +-------------- .../global_objects/string/tolowercase/index.html | 54 +--------------- .../global_objects/string/tosource/index.html | 52 +--------------- .../global_objects/string/tostring/index.html | 50 +-------------- .../global_objects/string/trimend/index.html | 2 +- .../global_objects/string/trimstart/index.html | 2 +- 37 files changed, 81 insertions(+), 1308 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/string') diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/@@iterator/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/@@iterator/index.html index abbf9ae0b8..65ea0ae37f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/@@iterator/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/@@iterator/index.html @@ -78,57 +78,7 @@ for (var v of string) {

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支持{{CompatVersionUnknown}}{{CompatGeckoDesktop("36")}} [1]{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持{{CompatNo}}{{CompatVersionUnknown}}{{CompatGeckoMobile("36")}} [1]{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -

[1] From Gecko 17 (Firefox 17 / Thunderbird 17 / SeaMonkey 2.14) to Gecko 26 (Firefox 26 / Thunderbird 26 / SeaMonkey 2.23 / Firefox OS 1.2) the iterator property was used (bug 907077), and from Gecko 27 to Gecko 35 the "@@iterator" placeholder was used. In Gecko 36 (Firefox 36 / Thunderbird 36 / SeaMonkey 2.33), the @@iterator symbol got implemented (bug 918828).

+{{Compat}}

相关链接

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 43ab947d68..25608cd5ee 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 @@ -13,9 +13,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/anchor

概述

-
-

已废弃
- 该特性已经从 Web 标准中删除,虽然一些浏览器目前仍然支持它,但也许会在未来的某个时间停止支持,请尽量不要使用该特性。

+
+

警告:该特性已经从 Web 标准中删除,虽然一些浏览器目前仍然支持它,但也许会在未来的某个时间停止支持,请尽量不要使用该特性。

anchor() 方法创建一个 {{HTMLElement("a")}} HTML 锚元素,被用作超文本靶标(hypertext target)。

@@ -75,59 +74,7 @@ document.body.innerHTML = myString.anchor("contents_anchor");

浏览器兼容性

-

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatGeckoDesktop("1.0") }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatGeckoMobile("1.0") }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -

Gecko-specific notes

- -

从{{gecko("17")}}开始  " (引号) 被 HTML引用字符 &quot所替代;在字符串中申请命名参数.

+{{Compat}}

相关链接

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/big/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/big/index.html index e45ae963c1..0d6104c911 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/big/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/big/index.html @@ -8,7 +8,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/big

big()方法的作用是创建一个使字符串显示大号字体的{{HTMLElement("big")}}标签。

-

使用说明:  <big> 元素在HTML5中已经被移除了,不应该再使用它。 取而代之的是web开发人员应该使用CSS 属性。

+

备注:  <big> 元素在HTML5中已经被移除了,不应该再使用它。 取而代之的是web开发人员应该使用CSS 属性。

语法

@@ -65,55 +65,7 @@ console.log(worldString.fontsize(7)); // <fontsize=7>Hello, world</font

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相关链接

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/blink/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/blink/index.html index e423d8fbfd..a9767ac29a 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/blink/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/blink/index.html @@ -60,55 +60,7 @@ console.log(worldString.strike()); // <strike>Hello, world</strike>

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相关链接

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/bold/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/bold/index.html index 43d6f9d448..07ab6f5e5f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/bold/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/bold/index.html @@ -60,55 +60,7 @@ console.log(worldString.strike()); // <strike>Hello, world</strike>

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相关连接

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 0e024365f2..bae0698030 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 @@ -217,55 +217,7 @@ function getWholeCharAndI (str, i) {

浏览器兼容性

-

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
+{{Compat}}

相关链接

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 ad5bd693df..149492f9d0 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 @@ -39,8 +39,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/charCodeAt

Unicode 码点(code points)的范围从 01114111 (0x10FFFF)。开头的 128 个 Unicode 编码单元和 ASCII 字符编码一样。(关于 Unicode 的更多信息,可查看 JavaScript Guide。)

-
-

注意:charCodeAt 总是返回一个小于 65,536 的值。这是因为高位编码单元(higher code point)使用一对(低位编码 lower valued)代理伪字符("surrogate" pseudo-characters)来表示,从而构成一个真正的字符。

+
+

备注:charCodeAt 总是返回一个小于 65,536 的值。这是因为高位编码单元(higher code point)使用一对(低位编码 lower valued)代理伪字符("surrogate" pseudo-characters)来表示,从而构成一个真正的字符。

因此,为了检查(或重现)65536 及以上编码字符的完整字符,需要在获取 charCodeAt(i) 的值的同时获取 charCodeAt(i+1) 的值(如同用两个字母操纵一个字符串),或者改为获取 codePointAt(i) 的值。参看下面例 2 和例 3。

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/codepointat/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/codepointat/index.html index 9a204e9c4b..d5dc1ad036 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/codepointat/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/codepointat/index.html @@ -113,55 +113,7 @@ if (!String.prototype.codePointAt) {

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
特性ChromeFirefox (Gecko)Internet ExplorerOperaSafari
基本支持{{CompatChrome("41")}}{{CompatGeckoDesktop("29")}}11{{CompatOpera("28")}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
特性AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持{{CompatNo}}{{CompatNo}}{{CompatGeckoMobile("29")}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
+{{Compat}}

相关链接

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 6fd1d90c0d..5b410acc42 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 @@ -58,55 +58,7 @@ console.log(worldString.fixed()); // "<tt>Hello, world</tt>"

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
版本ChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
版本AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相关链接

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/fontcolor/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/fontcolor/index.html index 551cb5ffa0..05d9645258 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/fontcolor/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/fontcolor/index.html @@ -16,7 +16,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fontcolor

fontcolor()方法创建一个{{HTMLElement("font")}}的HTML元素让字符串被显示成指定的字体颜色。

-

使用注意:<font>元素已经在在HTML5中被移除并且不应该在使用。替代的是,web开发者应该使用CSS属性。

+

备注:<font>元素已经在在HTML5中被移除并且不应该在使用。替代的是,web开发者应该使用CSS属性。

语法

@@ -32,9 +32,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fontcolor

返回值

-
-
一个包含一个{{HTMLElement("font")}} HTML元素的字符串。
-
+

一个包含一个{{HTMLElement("font")}} HTML元素的字符串。

描述

@@ -82,55 +80,7 @@ console.log(worldString.fontcolor('FF00') + ' is red in hexadecimal'

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox(Gecko)Internet ExplorerOperaSafari
Basic Support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile(Gecko)IE MobileOpera MobileSafari Mobile
Basic Support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

也可以看看

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/fontsize/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/fontsize/index.html index 005cfe0fb0..339b250b82 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/fontsize/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/fontsize/index.html @@ -8,7 +8,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fontsize

The fontsize() method creates a {{HTMLElement("font")}} HTML element that causes a string to be displayed in the specified font size.

-

Usage note: The <font> element has been removed in HTML5 and shouldn't be used anymore. Instead web developers should use CSS properties.

+

备注: The <font> element has been removed in HTML5 and shouldn't be used anymore. Instead web developers should use CSS properties.

语法

@@ -72,55 +72,7 @@ console.log(worldString.fontsize(7)); // <font size="7">Hello, world</f

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相关链接

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/fromcodepoint/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/fromcodepoint/index.html index d7c6ad0ccd..5a8a4a6c14 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/fromcodepoint/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/fromcodepoint/index.html @@ -20,13 +20,12 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCodePoint
num1, ..., numN
一串 Unicode 编码位置,即“代码点”。
-
-

返回值

- -

使用指定的 Unicode 编码位置创建的字符串。

-
+

返回值

+ +

使用指定的 Unicode 编码位置创建的字符串。

+

异常

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 6784bfb61f..97b7bf23aa 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 @@ -25,12 +25,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/includes
要在此字符串中搜索的字符串。
position {{optional_inline}}
从当前字符串的哪个索引位置开始搜寻子字符串,默认值为 0
-
-

返回值

-
-
如果当前字符串包含被搜寻的字符串,就返回 true;否则返回 false
+

返回值

+

如果当前字符串包含被搜寻的字符串,就返回 true;否则返回 false

+

描述

这个方法可以帮你判断一个字符串是否包含另外一个字符串。

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 8a6daf8511..26777dcf2e 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 @@ -118,7 +118,7 @@ new String(thing) -
和其他语言不同,javascript 的字符串不区分单引号和双引号,所以不论是单引号还是双引号的字符串,上面的转义字符都能运行 。
+

备注:和其他语言不同,javascript 的字符串不区分单引号和双引号,所以不论是单引号还是双引号的字符串,上面的转义字符都能运行 。

长字符串

@@ -203,7 +203,9 @@ console.log(eval(s2)); // returns the string "2 + 2"
console.log(eval(s2.valueOf())); // returns the number 4
 
-
注意: 其他的将字符串对象转换成基本字符串的方法可以及参考 StringView – a C-like representation of strings based on typed arrays.
+
+

备注: 其他的将字符串对象转换成基本字符串的方法可以及参考 StringView – a C-like representation of strings based on typed arrays.

+

属性

@@ -231,7 +233,7 @@ console.log(eval(s2)); // returns the string "2 + 2"

字符串泛型方法

-

字符串泛型是非标准的已弃用并且会在不远的将来删除。注意,你不能依靠他们的跨浏览器,而不使用下面提供的垫片。

+

警告:字符串泛型是非标准的已弃用并且会在不远的将来删除。注意,你不能依靠他们的跨浏览器,而不使用下面提供的垫片。

应该避免在 Javascript 1.6 (Firefox 浏览器的 JS 引擎)中使用(虽然也支持)将其他对象转化为字符的方法,因为方法并没有成为 ECMA 标准:

@@ -293,57 +295,7 @@ for (let i = 0, n = inputValues.length; i < n; ++i) {

浏览器兼容性

-

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support0.2{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -

+{{Compat}}

相关链接

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 b976a54b65..c12312dba9 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 @@ -18,7 +18,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/indexOf -
Note: For the Array method, see {{jsxref("Array.prototype.indexOf()")}}.
+
+

备注: For the Array method, see {{jsxref("Array.prototype.indexOf()")}}.

+

语法

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/italics/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/italics/index.html index 91f574b4bf..d94a82229d 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/italics/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/italics/index.html @@ -48,57 +48,9 @@ console.log(worldString.strike()); // Hello, world -

Browser compatibility

+

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

See also

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 297d9f6d89..e963adf719 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 @@ -20,11 +20,10 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
一个字符串,表示被查找的值。如果searchValue是空字符串,则返回fromIndex
fromIndex{{optional_inline}}
待匹配字符串searchValue的开头一位字符从 str的第fromIndex位开始向左回向查找。fromIndex默认值是 +Infinity。如果 fromIndex >= str.length ,则会搜索整个字符串。如果 fromIndex < 0 ,则等同于 fromIndex == 0
-
-

返回值

-
+

返回值

+

返回指定值最后一次出现的索引(该索引仍是以从左至右0开始记数的),如果没找到则返回-1。

描述

@@ -41,8 +40,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf 'canal'.lastIndexOf('', 2); // returns 2 -
-

Note: 'abab'.lastIndexOf('ab', 2) 将返回 2 而不是 0, 因为fromIndex只限制待匹配字符串的开头。

+
+

备注:'abab'.lastIndexOf('ab', 2) 将返回 2 而不是 0, 因为fromIndex只限制待匹配字符串的开头。

(例如'abadefgabm'.lastIndexOf('ab', 7) 返回7,虽然查找的'ab'中的b已经在 index=8的位置了从index=7的a处向左查找仍是能找到自身a加上其后连成ab,因为fromIndex指的是待匹配字符串的开头那一个)

@@ -101,55 +100,7 @@ console.log("The index of 'new' from the end is " + anyString.lastIndexOf("new")

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat}}

相关链接

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 afef2dd204..f75e5eabdb 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 @@ -62,55 +62,7 @@ console.log("The empty string is has a length of " + empty.length);

浏览器兼容性

-

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
-
+{{Compat}}

相关链接

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 57bd74a182..48e537cb96 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 @@ -38,9 +38,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match
  • input: 搜索的字符串.
  • -
    -
    一个{{jsxref("Array")}},其内容取决于global(g)标志的存在与否,如果未找到匹配则为{{jsxref("null")}}。
    -
    +

    一个{{jsxref("Array")}},其内容取决于global(g)标志的存在与否,如果未找到匹配则为{{jsxref("null")}}。

    描述

    @@ -60,7 +58,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/match

    在下例中,使用 match 查找 "Chapter" 紧跟着 1 个或多个数值字符,再紧跟着一个小数点和数值字符 0 次或多次。正则表达式包含 i 标志,因此大小写会被忽略。

    -
    var str = 'For more information, see Chapter 3.4.5.1';
    +
    var str = 'For more information, see Chapter 3.4.5.1';
     var re = /see (chapter \d+(\.\d)*)/i;
     var found = str.match(re);
     
    @@ -82,7 +80,7 @@ console.log(found);
     
     

    下例展示了 match 使用 global 和 ignore case 标志。A-E、a-e 的所有字母将会作为一个数组的元素返回。

    -
    var str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
    +
    var str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
     var regexp = /[A-E]/gi;
     var matches_array = str.match(regexp);
     
    @@ -91,7 +89,7 @@ console.log(matches_array);
     
     

    使用match(),不传参数

    -
    var str = "Nothing will come of nothing.";
    +
    var str = "Nothing will come of nothing.";
     
     str.match();   // returns [""]
    @@ -99,7 +97,7 @@ str.match(); // returns [""]

    当参数是一个字符串或一个数字,它会使用new RegExp(obj)来隐式转换成一个 {{jsxref("RegExp")}}。如果它是一个有正号的正数,RegExp() 方法将忽略正号。

    -
    var str1 = "NaN means not a number. Infinity contains -Infinity and +Infinity in JavaScript.",
    +
    var str1 = "NaN means not a number. Infinity contains -Infinity and +Infinity in JavaScript.",
         str2 = "My grandfather is 65 years old and My grandmother is 63 years old.",
         str3 = "The contract was declared null and void.";
     str1.match("number");   // "number" 是字符串。返回["number"]
    @@ -145,64 +143,7 @@ str3.match(null);       // 返回["null"]

    浏览器兼容性

    -

    {{ CompatibilityTable() }}

    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    - -

    Firefox 特殊注意

    - -
      -
    • 从Gecko 27 {{geckoRelease(27)}}开始,此方法遵守ECMAScript 规范。当使用全局正则表达式调用 match()时,{{jsxref("RegExp.lastIndex")}} 属性(如果指定)会重置为 0 ({{bug(501739)}})。
    • -
    • 从 Gecko 39 {{geckoRelease(39)}}开始,不赞成使用非标准的标志参数,并抛出一个控制台警告({{bug(1142351)}})。
    • -
    • 从 Gecko 47 {{geckoRelease(47)}} 开始 , non-release builds不再支持非标准的标志参数,并且将完全移除({{bug(1245801)}})。
    • -
    • 从 Gecko 49 {{geckoRelease(49)}} 开始 , 不再支持非标准的标志参数 ({{bug(1108382)}}).
    • -
    +{{Compat}}

    相关链接

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/matchall/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/matchall/index.html index d11d23265e..662d4ff564 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/matchall/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/matchall/index.html @@ -24,9 +24,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/matchAll

    参数

    -
    -
    regexp
    -
    +

    regexp

        正则表达式对象。如果所传参数不是一个正则表达式对象,则会隐式地使用 new RegExp(obj) 将其转换为一个 RegExp 。

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/padstart/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/padstart/index.html index c358da2585..1d1a9c1176 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/padstart/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/padstart/index.html @@ -35,7 +35,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/padStart

    示例

    -
    'abc'.padStart(10);         // "       abc"
    +
    'abc'.padStart(10);         // "       abc"
     'abc'.padStart(10, "foo");  // "foofoofabc"
     'abc'.padStart(6,"123465"); // "123abc"
     'abc'.padStart(8, "0");     // "00000abc"
    @@ -45,7 +45,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/padStart
     
     

    如果原生环境不支持该方法,在其他代码之前先运行下面的代码,将创建 String.prototype.padStart() 方法。

    -
    // https://github.com/uxitten/polyfill/blob/master/string.polyfill.js
    +
    // https://github.com/uxitten/polyfill/blob/master/string.polyfill.js
     // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
     if (!String.prototype.padStart) {
         String.prototype.padStart = function padStart(targetLength,padString) {
    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 45ea5be584..c63c2144f4 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
    @@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat
     
     

    此方法已添加到 ECMAScript 2015 规范中,并且可能尚未在所有 JavaScript 实现中可用。然而,你可以使用以下代码段对 String.prototype.repeat() 进行填充:

    -
    if (!String.prototype.repeat) {
    +
    if (!String.prototype.repeat) {
       String.prototype.repeat = function(count) {
         'use strict';
         if (this == null) {
    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 3bc425e928..66226c970e 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
    @@ -53,8 +53,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replace
     
    -   
    -   
    +   
    +   
    @@ -94,8 +94,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replace
     
    变量名代表的值变量名代表的值
    $$
    - - + + diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/replaceall/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/replaceall/index.html index c9d892e3f7..726bfe2530 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/replaceall/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/replaceall/index.html @@ -21,8 +21,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replaceAll
    const newStr = str.replaceAll(regexp|substr, newSubstr|function)
    -
    -

    当使用一个 `regex`时,您必须设置全局(“ g”)标志,
    +

    +

    备注:当使用一个 `regex`时,您必须设置全局(“ g”)标志,
    否则,它将引发 TypeError:“必须使用全局 RegExp 调用 replaceAll”。

    @@ -54,8 +54,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replaceAll
    变量名代表的值变量名代表的值
    match
    - - + + @@ -93,8 +93,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replaceAll
    PatternInsertsPatternInserts
    - - + + diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/small/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/small/index.html index 834ceed5ac..72b59b6142 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/small/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/small/index.html @@ -61,55 +61,7 @@ console.log(worldString.fontsize(7)); // <font size="7">Hello, world</f

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    -
    Possible nameSupplied valuePossible nameSupplied value
    - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    相关链接

    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 75ba2c0748..e6eb4945f6 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 @@ -23,8 +23,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/split
    str.split([separator[, limit]])
     
    -
    -

    注意:如果使用空字符串(“)作为分隔符,则字符串不是在每个用户感知的字符(图形素集群)之间,也不是在每个Unicode字符(代码点)之间,而是在每个UTF-16代码单元之间。这会摧毁代理对。还请参见how do you get a string to a character array in javascript

    +
    +

    警告:如果使用空字符串(“)作为分隔符,则字符串不是在每个用户感知的字符(图形素集群)之间,也不是在每个Unicode字符(代码点)之间,而是在每个UTF-16代码单元之间。这会摧毁代理对。还请参见how do you get a string to a character array in javascript

    参数

    @@ -155,8 +155,8 @@ console.log(splits); //["c", "c,", "c", "c", "c"]

    用split()来颠倒字符串顺序

    -
    -

    注意这并非一种很健壮的逆转字符串的方法:

    +
    +

    警告:注意这并非一种很健壮的逆转字符串的方法:

    const str = 'asdfghjkl';
     const strReverse = str.split('').reverse().join(''); // 'lkjhgfdsa'
    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/strike/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/strike/index.html
    index 12304c18cf..3bea6eba71 100644
    --- a/files/zh-cn/web/javascript/reference/global_objects/string/strike/index.html
    +++ b/files/zh-cn/web/javascript/reference/global_objects/string/strike/index.html
    @@ -57,55 +57,7 @@ console.log(worldString.strike()); // <strike>Hello, world</strike>
     
     

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    另见

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/sub/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/sub/index.html index 69402cb285..6662e050e4 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/sub/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/sub/index.html @@ -62,55 +62,7 @@ console.log('This is what a ' + subText.sub() + ' looks like.');

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    另见

    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 5c94a75240..4916b09abe 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 @@ -7,7 +7,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substr ---

    {{JSRef}}

    -
    警告: 尽管 String.prototype.substr(…) 没有严格被废弃 (as in "removed from the Web standards"), 但它被认作是遗留的函数并且可以的话应该避免使用。它并非JavaScript核心语言的一部分,未来将可能会被移除掉。如果可以的话,使用 substring() 替代它.
    +

    警告:尽管 String.prototype.substr(…) 没有严格被废弃 (as in "removed from the Web standards"), 但它被认作是遗留的函数并且可以的话应该避免使用。它并非JavaScript核心语言的一部分,未来将可能会被移除掉。如果可以的话,使用 substring() 替代它.

    substr() 方法返回一个字符串中从指定位置开始到指定字符数的字符。

    @@ -103,57 +103,7 @@ if ('ab'.substr(-1) != 'b')

    浏览器兼容性

    -

    {{ CompatibilityTable() }}

    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    - -

    Note: Up to version 3.6, Firefox had a bug which caused substr to return empty result when an explicit undefined value was passed in as the length.

    +{{Compat}}

    相关链接

    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 6aef7ea138..bf4162a1c3 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 @@ -136,55 +136,7 @@ replaceString("World", "Web", "Brave New World");

    浏览器兼容性

    -

    {{ CompatibilityTable() }}

    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    +{{Compat}}

    相关链接

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/sup/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/sup/index.html index 15616dfc08..0027d16fd0 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/sup/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/sup/index.html @@ -61,55 +61,7 @@ console.log('This is what a ' + subText.sub() + ' looks like.');

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    另见

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/tolocalelowercase/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/tolocalelowercase/index.html index c4f1025029..e3675a0195 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/tolocalelowercase/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/tolocalelowercase/index.html @@ -86,55 +86,7 @@ let locales = ['tr', 'TR', 'tr-TR', 'tr-u-co-search', 'tr-x-turkish'];

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    参阅

    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 e8fd231457..f492176f46 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 @@ -15,7 +15,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase

    语法

    -
    str.toLowerCase()
    +
    str.toLowerCase()
     

    返回值

    @@ -36,8 +36,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase ​console.log( "ALPHABET".toLowerCase() ); // "alphabet"
    -
    -

    说明

    @@ -75,55 +73,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
    -
    +{{Compat}}

    相关链接

    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/tosource/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/tosource/index.html index 756758d877..1b6c4f7a85 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/tosource/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/tosource/index.html @@ -32,57 +32,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/toSource

    不属于任何标准. 在 JavaScript 1.3实现了.

    -

    浏览器适配

    +

    浏览器兼容性

    -
    {{CompatibilityTable}}
    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
    -
    +{{Compat}}

    参见

    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 ff09cb22b0..98d7890b15 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 @@ -66,55 +66,7 @@ alert(x.toString()) // 输出 "Hello world"

    浏览器兼容性

    -

    {{ CompatibilityTable() }}

    - -
    - - - - - - - - - - - - - - - - - - - -
    FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
    Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
    -
    +{{Compat}}

    相关链接

    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 1edf0d9200..59e70e782b 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 @@ -43,7 +43,7 @@ original_slug: Web/JavaScript/Reference/Global_Objects/String/TrimRight

    下面的例子输出了小写的字符串"   foo":

    -
    var str = "   foo  ";
    +
    var str = "   foo  ";
     
     alert(str.length); // 8
     
    diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/trimstart/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/trimstart/index.html
    index 48718fcb13..655126befb 100644
    --- a/files/zh-cn/web/javascript/reference/global_objects/string/trimstart/index.html
    +++ b/files/zh-cn/web/javascript/reference/global_objects/string/trimstart/index.html
    @@ -45,7 +45,7 @@ original_slug: Web/JavaScript/Reference/Global_Objects/String/TrimLeft
     
     

    下面的例子输出了小写的字符串 "foo  "

    -
    var str = "   foo  ";
    +
    var str = "   foo  ";
     
     console.log(str.length); // 8
     
    -- 
    cgit v1.2.3-54-g00ecf