From 012ee621791b6895e637f96e6523027951768f25 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:03:27 +0800 Subject: remove inline style for zh-CN --- .../global_objects/string/concat/index.html | 2 +- .../global_objects/string/fixed/index.html | 2 +- .../global_objects/string/length/index.html | 56 ++++++++-------------- .../global_objects/string/replace/index.html | 4 +- .../global_objects/string/slice/index.html | 6 +-- .../global_objects/string/substr/index.html | 2 +- .../global_objects/string/tolowercase/index.html | 12 ++--- 7 files changed, 34 insertions(+), 50 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/string') 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

如果参数不是字符串类型,它们在连接之前将会被转换成字符串。

-

性能

+

性能

强烈建议使用赋值操作符+, +=)代替 concat 方法。

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

描述

-

fixed() 方法将一个字符串包裹在<tt></tt>标签中,比如: "<tt>str</tt>".

+

fixed() 方法将一个字符串包裹在<tt></tt>标签中,比如: "<tt>str</tt>".

举例

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 ---

{{JSRef("Global_Objects", "String")}}

-

概述

+

概述

length 属性表示一个字符串的长度。

-

描述

+

描述

该属性返回字符串中字符编码单元的数量。JavaScript 使用 {{ interwiki("wikipedia", "UTF-16") }} 编码,该编码使用一个 16 比特的编码单元来表示大部分常见的字符,使用两个代码单元表示不常用的字符。因此 length 返回值可能与字符串中实际的字符数量不相同。

@@ -22,7 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/length

静态属性 String.length 返回 1。

-

示例

+

示例

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" */
-
 
- -
 
- -
 
- -
 
- -
 
- -
 
- -
 
- -
 
- -

规范

+

规范

@@ -76,7 +60,7 @@ console.log("The empty string is has a length of " + empty.length);
-

浏览器兼容性

+

浏览器兼容性

{{ CompatibilityTable() }}

@@ -84,12 +68,12 @@ console.log("The empty string is has a length of " + empty.length); - - - - - - + + + + + + @@ -107,13 +91,13 @@ console.log("The empty string is has a length of " + empty.length);
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafariFeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support
- - - - - - - + + + + + + + @@ -128,8 +112,8 @@ console.log("The empty string is has a length of " + empty.length);
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileFeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support
-

相关链接

+

相关链接

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 插入当前匹配的子串右边的内容。 - $n + $n

假如第一个参数是 {{jsxref("RegExp")}}对象,并且 n 是个小于100的非负整数,那么插入第 n 个括号匹配的字符串。提示:索引是从1开始。如果不存在第 n个分组,那么将会把匹配到到内容替换为字面量。比如不存在第3个分组,就会用“$3”替换匹配到的内容。

- $<Name> + $<Name>  这里Name 是一个分组名称。如果在正则表达式中并不存在分组(或者没有匹配),这个变量将被处理为空字符串。只有在支持命名分组捕获的浏览器中才能使用。 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
beginIndex
从该索引(以 0 为基数)处开始提取原字符串中的字符。如果值为负数,会被当做 strLength + beginIndex 看待,这里的strLength 是字符串的长度(例如, 如果 beginIndex 是 -3 则看作是:strLength - 3
endIndex
-
可选。在该索引(以 0 为基数)处结束提取字符串。如果省略该参数,slice() 会一直提取到字符串末尾。如果该参数为负数,则被看作是 strLength + endIndex,这里的 strLength 就是字符串的长度(例如,如果 endIndex 是 -3,则是, strLength - 3)。
+
可选。在该索引(以 0 为基数)处结束提取字符串。如果省略该参数,slice() 会一直提取到字符串末尾。如果该参数为负数,则被看作是 strLength + endIndex,这里的 strLength 就是字符串的长度(例如,如果 endIndex 是 -3,则是, strLength - 3)。

返回值

@@ -46,7 +46,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/slice

例 2:str.slice(2, -1) 提取第三个字符到倒数第一个字符。

-

例子

+

例子

使用 slice() 创建一个新的字符串

@@ -73,7 +73,7 @@ str.slice(-3, -1); // 返回 'us' str.slice(0, -1); // 返回 'The morning is upon us' -

规范

+

规范

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
start
-
开始提取字符的位置。如果为负值,则被看作 strLength + start,其中 strLength 为字符串的长度(例如,如果 start-3,则被看作 strLength + (-3))。
+
开始提取字符的位置。如果为负值,则被看作 strLength + start,其中 strLength 为字符串的长度(例如,如果 start-3,则被看作 strLength + (-3))。
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

toLowerCase() 会将调用该方法的字符串值转为小写形式,并返回。

-

语法

+

语法

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

返回值

一个新的字符串,表示转换为小写的调用字符串。

-

描述

+

描述

toLowerCase 会将调用该方法的字符串值转为小写形式,并返回。toLowerCase 不会影响字符串本身的值。

-

示例

+

示例

-

例子:使用 toLowerCase()

+

例子:使用 toLowerCase()

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"
-
+

说明

-- cgit v1.2.3-54-g00ecf