From 12a899ab8540bc84f56a0dc6491be80a48499d49 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove name attribute for zh-TW --- .../reference/global_objects/string/index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/global_objects/string/index.html') diff --git a/files/zh-tw/web/javascript/reference/global_objects/string/index.html b/files/zh-tw/web/javascript/reference/global_objects/string/index.html index 8ab9244b71..e29b6b8cea 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/string/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/string/index.html @@ -12,7 +12,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String

String 全域物件為字串的構造函數,或是一個字符序列。

-

語法

+

語法

字串文字採用下列形式:

@@ -22,7 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String
String(thing)
-

參數

+

參數

thing
@@ -130,11 +130,11 @@ otherwise my code is unreadable.";

這兩個方法都會建立相同的字串內容。

-

說明

+

說明

字串對於能保留以文字形式表達的資料這件事來說,是有用的。在字串上,一些最常被使用的運算即確認字串長度 {{jsxref("String.length", "length")}} ,用 + 或 += 字串運算元 建造或者串接字串,用 {{jsxref("String.indexOf", "indexOf")}} 方法檢查?子字串是否存在或子字串的位置,或者是用 {{jsxref("String.substring", "substring")}} 方法將子字串抽取出來。

-

存取字元

+

存取字元

有兩個方法可以存取字串中個別的字元。第一個是用 {{jsxref("String.charAt", "charAt")}} 方法:

@@ -148,7 +148,7 @@ otherwise my code is unreadable.";

對於存取字元使用的括號表達式,沒辦法去刪除或指派一個值給這些屬性。 這些屬性既非可寫的,也非可設定的。(參見 {{jsxref("Object.defineProperty")}})

-

比較字串

+

比較字串

C 語言的開發者有 strcmp() 函式可以用來比較字串。 在 JavaScript 中,你只能用小於和大於運算子

@@ -194,7 +194,7 @@ console.log(eval(s2)); // 回傳字串 "2 + 2"
注意: 對於在 JavaScript 中其他可用的字串方法,請參閱這篇文章StringView – a C-like representation of strings based on typed arrays
-

屬性

+

屬性

{{jsxref("String.prototype")}}
@@ -203,7 +203,7 @@ console.log(eval(s2)); // 回傳字串 "2 + 2"
{{jsOverrides("Function", "Properties", "prototype")}}
-

方法

+

方法

{{jsxref("String.fromCharCode()")}}
@@ -261,7 +261,7 @@ alert(String.replace(num, /5/, '2')); } }()); -

String instances

+

String instances

Properties

-- cgit v1.2.3-54-g00ecf