From 8ccfa93045a6c119303566370999f59a0aae3b25 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:13:18 +0800 Subject: adjust dl/dt/dd tags for zh-CN --- .../reference/global_objects/string/charat/index.html | 4 +--- .../reference/global_objects/string/index.html | 3 --- .../reference/global_objects/string/indexof/index.html | 8 ++------ .../global_objects/string/localecompare/index.html | 18 ++++++------------ .../reference/global_objects/string/replace/index.html | 9 --------- .../reference/global_objects/string/search/index.html | 3 +-- .../reference/global_objects/string/substr/index.html | 3 --- 7 files changed, 10 insertions(+), 38 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/string') 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 ab72e58c81..0e024365f2 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 @@ -19,9 +19,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/charAt
index
-
一个介于0 和字符串长度减1之间的整数。 (0~length-1)
-
如果没有提供索引,charAt() 将使用0。
-
 
+
一个介于0 和字符串长度减1之间的整数。 (0~length-1)如果没有提供索引,charAt() 将使用0。

描述

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 6b8d96b0ac..8a6daf8511 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 @@ -217,9 +217,6 @@ console.log(eval(s2)); // returns the string "2 + 2"
{{jsxref("String.fromCharCode()")}}  
 通过一串 Unicode 创建字符串。
-
- -
{{jsxref("String.fromCodePoint()")}} {{experimental_inline}}
通过一串 码点 创建字符串。
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 40fceeeadd..b976a54b65 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 @@ -28,13 +28,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/indexOf
searchValue
-
要被查找的字符串值。
-
如果没有提供确切地提供字符串,searchValue 会被强制设置为 "undefined", 然后在当前字符串中查找这个值。
-
举个例子:'undefined'.indexOf() 将会返回0,因为 undefined 在位置0处被找到,但是 'undefine'.indexOf() 将会返回 -1 ,因为字符串 'undefined' 未被找到。
+
要被查找的字符串值。如果没有提供确切地提供字符串,searchValue 会被强制设置为 "undefined", 然后在当前字符串中查找这个值。举个例子:'undefined'.indexOf() 将会返回0,因为 undefined 在位置0处被找到,但是 'undefine'.indexOf() 将会返回 -1 ,因为字符串 'undefined' 未被找到。
fromIndex {{optional_inline}}
-
数字表示开始查找的位置。可以是任意整数,默认值为 0
-
如果 fromIndex 的值小于 0,或者大于 str.length ,那么查找分别从 0 和str.length 开始。(译者注:  fromIndex 的值小于 0,等同于为空情况; fromIndex 的值大于或等于 str.length ,那么结果会直接返回 -1 。)
-
举个例子,'hello world'.indexOf('o', -5) 返回 4 ,因为它是从位置0处开始查找,然后 o 在位置4处被找到。另一方面,'hello world'.indexOf('o', 11) (或 fromIndex 填入任何大于11的值)将会返回 -1 ,因为开始查找的位置11处,已经是这个字符串的结尾了。
+
数字表示开始查找的位置。可以是任意整数,默认值为 0。如果 fromIndex 的值小于 0,或者大于 str.length ,那么查找分别从 0 和str.length 开始。(译者注:  fromIndex 的值小于 0,等同于为空情况; fromIndex 的值大于或等于 str.length ,那么结果会直接返回 -1 。)举个例子,'hello world'.indexOf('o', -5) 返回 4 ,因为它是从位置0处开始查找,然后 o 在位置4处被找到。另一方面,'hello world'.indexOf('o', 11) (或 fromIndex 填入任何大于11的值)将会返回 -1 ,因为开始查找的位置11处,已经是这个字符串的结尾了。

返回值

diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/localecompare/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/localecompare/index.html index bf0e8ad0fb..88644d61b8 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/localecompare/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/localecompare/index.html @@ -29,13 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/localeCompare
compareString
用来比较的字符串
locales
-
可选。 用来表示一种或多种语言或区域的一个符合 BCP 47 标准的字符串或一个字符串数组。 locales参数的一般形式与解释, 详情请参考 Intl page。 下列的 Unicode 扩展关键词是允许的:
-
co
-
为了某些地域多样的排序规则。可能的值包括: "big5han""dict""direct""ducet""gb2312""phonebk""phonetic""pinyin""reformed""searchjl""stroke""trad""unihan"。 "standard" 和"search" 这两个值是被忽略的; 它们被 options 的属性 usage 代替(往下看)。
-
kn
-
指定数值排序是否应该被使用, 像是这样 "1" < "2" < "10"。 可能的值是 "true" 和 "false"。 这个选项能被通过options 属性设置或通过 Unicode 扩展。 假如两个都被设置了, 则 options 优先。("language-region-u-kn-true|false")
-
kf
-
指定是否优先对大写字母或小写字母排序。 可能的值有 "upper""lower", 或 "false" (use the locale's default)。这个选项能被通过options 属性设置或通过 Unicode 扩展。假如两个都被设置了, 则 options 优先。("language-region-u-kf-upper|lower|false")
+
可选。 用来表示一种或多种语言或区域的一个符合 BCP 47 标准的字符串或一个字符串数组。 locales参数的一般形式与解释, 详情请参考 Intl page。 下列的 Unicode 扩展关键词是允许的:co为了某些地域多样的排序规则。可能的值包括: "big5han""dict""direct""ducet""gb2312""phonebk""phonetic""pinyin""reformed""searchjl""stroke""trad""unihan"。 "standard" 和"search" 这两个值是被忽略的; 它们被 options 的属性 usage 代替(往下看)。kn指定数值排序是否应该被使用, 像是这样 "1" < "2" < "10"。 可能的值是 "true" 和 "false"。 这个选项能被通过options 属性设置或通过 Unicode 扩展。 假如两个都被设置了, 则 options 优先。("language-region-u-kn-true|false")kf指定是否优先对大写字母或小写字母排序。 可能的值有 "upper""lower", 或 "false" (use the locale's default)。这个选项能被通过options 属性设置或通过 Unicode 扩展。假如两个都被设置了, 则 options 优先。("language-region-u-kf-upper|lower|false")
options

可选。 支持下列的一些或全部属性的一个对象:

@@ -65,14 +59,14 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/localeCompare
caseFirst
指定大小写有限排序. 可能的值有 "upper""lower", or "false" (use the locale's default); 默认为 "false". 这个选项能被通过options 属性设置或通过 Unicode 扩展。假如两个都被设置了, 则 options 优先。 实现不用必须支持这个属性.
- -
+ + +

返回值

如果引用字符存在于比较字符之前则为负数; 如果引用字符存在于比较字符之后则为正数; 相等的时候返回 0 .

-
-
page('/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Collator', 'Parameters')}}
- + + {{page('/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Collator', 'Parameters')}}

描述

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 5e75b81d05..3bc425e928 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 @@ -28,19 +28,10 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replace
regexp (pattern)
一个{{jsxref("RegExp")}} 对象或者其字面量。该正则所匹配的内容会被第二个参数的返回值替换掉。
-
- -
substr (pattern)
一个将被 newSubStr 替换的 {{jsxref("String","字符串")}}。其被视为一整个字符串,而不是一个正则表达式。仅第一个匹配项会被替换。
-
- -
newSubStr (replacement)
用于替换掉第一个参数在原字符串中的匹配部分的{{jsxref("String", "字符串")}}。该字符串中可以内插一些特殊的变量名。参考下面的使用字符串作为参数
-
- -
function (replacement)
一个用来创建新子字符串的函数,该函数的返回值将替换掉第一个参数匹配到的结果。参考下面的指定一个函数作为参数
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/search/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/search/index.html index 35a75549c2..a021bd662b 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/search/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/search/index.html @@ -26,8 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/search
regexp
-
一个{{jsxref("RegExp", "正则表达式(regular expression)")}}对象
-
如果传入一个非正则表达式对象 regexp,则会使用 new RegExp(regexp) 隐式地将其转换为正则表达式对象。
+
一个{{jsxref("RegExp", "正则表达式(regular expression)")}}对象。如果传入一个非正则表达式对象 regexp,则会使用 new RegExp(regexp) 隐式地将其转换为正则表达式对象。

返回值

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 a21f6f1f87..5c94a75240 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 @@ -20,9 +20,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/substr
start
开始提取字符的位置。如果为负值,则被看作 strLength + start,其中 strLength 为字符串的长度(例如,如果 start-3,则被看作 strLength + (-3))。
-
- -
length
可选。提取的字符数。
-- cgit v1.2.3-54-g00ecf