diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 13:12:08 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 13:12:08 +0100 |
commit | 43a5cac2eff22c21071800e13bef12af9d3a37d0 (patch) | |
tree | f6e91f8aa958f15bd0b0aabf7b8dfc09063eceda /files/zh-tw/web/javascript/reference/global_objects/string | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.tar.gz translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.tar.bz2 translated-content-43a5cac2eff22c21071800e13bef12af9d3a37d0.zip |
unslug zh-tw: move
Diffstat (limited to 'files/zh-tw/web/javascript/reference/global_objects/string')
-rw-r--r-- | files/zh-tw/web/javascript/reference/global_objects/string/prototype/index.html | 177 |
1 files changed, 0 insertions, 177 deletions
diff --git a/files/zh-tw/web/javascript/reference/global_objects/string/prototype/index.html b/files/zh-tw/web/javascript/reference/global_objects/string/prototype/index.html deleted file mode 100644 index 011c61418e..0000000000 --- a/files/zh-tw/web/javascript/reference/global_objects/string/prototype/index.html +++ /dev/null @@ -1,177 +0,0 @@ ---- -title: String.prototype -slug: Web/JavaScript/Reference/Global_Objects/String/prototype -translation_of: Web/JavaScript/Reference/Global_Objects/String -translation_of_original: Web/JavaScript/Reference/Global_Objects/String/prototype ---- -<div>{{JSRef}}</div> - -<p>The <strong><code>String.prototype</code></strong> property represents the {{jsxref("String")}} prototype object.</p> - -<div>{{js_property_attributes(0, 0, 0)}}</div> - -<h2 id="Description">Description</h2> - -<p>All {{jsxref("String")}} instances inherit from <code>String.prototype</code>. Changes to the <code>String</code> prototype object are propagated to all {{jsxref("String")}} instances.</p> - -<h2 id="Properties">Properties</h2> - -<dl> - <dt><code>String.prototype.constructor</code></dt> - <dd>Specifies the function that creates an object's prototype.</dd> - <dt>{{jsxref("String.prototype.length")}}</dt> - <dd>Reflects the length of the string.</dd> - <dt><code><em>N</em></code></dt> - <dd>Used to access the character in the <em>N</em>th position where <em>N</em> is a positive integer between 0 and one less than the value of {{jsxref("String.length", "length")}}. These properties are read-only.</dd> -</dl> - -<h2 id="Methods">Methods</h2> - -<h3 id="Methods_unrelated_to_HTML">Methods unrelated to HTML</h3> - -<dl> - <dt>{{jsxref("String.prototype.charAt()")}}</dt> - <dd>Returns the character (exactly one UTF-16 code unit) at the specified index.</dd> - <dt>{{jsxref("String.prototype.charCodeAt()")}}</dt> - <dd>Returns a number that is the UTF-16 code unit value at the given index.</dd> - <dt>{{jsxref("String.prototype.codePointAt()")}}</dt> - <dd>Returns a nonnegative integer Number that is the code point value of the UTF-16 encoded code point starting at the specified index.</dd> - <dt>{{jsxref("String.prototype.concat()")}}</dt> - <dd>Combines the text of two strings and returns a new string.</dd> - <dt>{{jsxref("String.prototype.includes()")}}</dt> - <dd>Determines whether one string may be found within another string.</dd> - <dt>{{jsxref("String.prototype.endsWith()")}}</dt> - <dd>Determines whether a string ends with the characters of another string.</dd> - <dt>{{jsxref("String.prototype.indexOf()")}}</dt> - <dd>Returns the index within the calling {{jsxref("String")}} object of the first occurrence of the specified value, or -1 if not found.</dd> - <dt>{{jsxref("String.prototype.lastIndexOf()")}}</dt> - <dd>Returns the index within the calling {{jsxref("String")}} object of the last occurrence of the specified value, or -1 if not found.</dd> - <dt>{{jsxref("String.prototype.localeCompare()")}}</dt> - <dd>Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.</dd> - <dt>{{jsxref("String.prototype.match()")}}</dt> - <dd>Used to match a regular expression against a string.</dd> - <dt>{{jsxref("String.prototype.normalize()")}}</dt> - <dd>Returns the Unicode Normalization Form of the calling string value.</dd> - <dt>{{jsxref("String.prototype.padEnd()")}}</dt> - <dd>Pads the current string from the end with a given string to create a new string from a given length.</dd> - <dt>{{jsxref("String.prototype.padStart()")}}</dt> - <dd>Pads the current string from the start with a given string to create a new string from a given length.</dd> - <dt><s class="obsoleteElement">{{jsxref("String.prototype.quote()")}} {{obsolete_inline}}</s></dt> - <dd><s class="obsoleteElement">Wraps the string in double quotes ("<code>"</code>").</s></dd> - <dt>{{jsxref("String.prototype.repeat()")}}</dt> - <dd>Returns a string consisting of the elements of the object repeated the given times.</dd> - <dt>{{jsxref("String.prototype.replace()")}}</dt> - <dd>Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.</dd> - <dt>{{jsxref("String.prototype.search()")}}</dt> - <dd>Executes the search for a match between a regular expression and a specified string.</dd> - <dt>{{jsxref("String.prototype.slice()")}}</dt> - <dd>Extracts a section of a string and returns a new string.</dd> - <dt>{{jsxref("String.prototype.split()")}}</dt> - <dd>Splits a {{jsxref("Global_Objects/String", "String")}} object into an array of strings by separating the string into substrings.</dd> - <dt>{{jsxref("String.prototype.startsWith()")}}</dt> - <dd>Determines whether a string begins with the characters of another string.</dd> - <dt>{{jsxref("String.prototype.substr()")}}</dt> - <dd>Returns the characters in a string beginning at the specified location through the specified number of characters.</dd> - <dt>{{jsxref("String.prototype.substring()")}}</dt> - <dd>Returns the characters in a string between two indexes into the string.</dd> - <dt>{{jsxref("String.prototype.toLocaleLowerCase()")}}</dt> - <dd>The characters within a string are converted to lower case while respecting the current locale. For most languages, this will return the same as {{jsxref("String.prototype.toLowerCase()", "toLowerCase()")}}.</dd> - <dt>{{jsxref("String.prototype.toLocaleUpperCase()")}}</dt> - <dd>The characters within a string are converted to upper case while respecting the current locale. For most languages, this will return the same as {{jsxref("String.prototype.toUpperCase()", "toUpperCase()")}}.</dd> - <dt>{{jsxref("String.prototype.toLowerCase()")}}</dt> - <dd>Returns the calling string value converted to lower case.</dd> - <dt>{{jsxref("String.prototype.toSource()")}} {{non-standard_inline}}</dt> - <dd>Returns an object literal representing the specified object; you can use this value to create a new object. Overrides the {{jsxref("Object.prototype.toSource()")}} method.</dd> - <dt>{{jsxref("String.prototype.toString()")}}</dt> - <dd>Returns a string representing the specified object. Overrides the {{jsxref("Object.prototype.toString()")}} method.</dd> - <dt>{{jsxref("String.prototype.toUpperCase()")}}</dt> - <dd>Returns the calling string value converted to uppercase.</dd> - <dt>{{jsxref("String.prototype.trim()")}}</dt> - <dd>Trims whitespace from the beginning and end of the string. Part of the ECMAScript 5 standard.</dd> - <dt>{{jsxref("String.prototype.trimLeft()")}} {{non-standard_inline}}</dt> - <dd>Trims whitespace from the left side of the string.</dd> - <dt>{{jsxref("String.prototype.trimRight()")}} {{non-standard_inline}}</dt> - <dd>Trims whitespace from the right side of the string.</dd> - <dt>{{jsxref("String.prototype.valueOf()")}}</dt> - <dd>Returns the primitive value of the specified object. Overrides the {{jsxref("Object.prototype.valueOf()")}} method.</dd> - <dt>{{jsxref("String.prototype.@@iterator()", "String.prototype[@@iterator]()")}}</dt> - <dd>Returns a new <code>Iterator</code> object that iterates over the code points of a String value, returning each code point as a String value.</dd> -</dl> - -<h3 id="HTML_wrapper_methods">HTML wrapper methods</h3> - -<p>These methods are of limited use, as they provide only a subset of the available HTML tags and attributes.</p> - -<dl> - <dt>{{jsxref("String.prototype.anchor()")}}</dt> - <dd>{{htmlattrxref("name", "a", "<a name=\"name\">")}} (hypertext target)</dd> - <dt>{{jsxref("String.prototype.big()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("big")}}</dd> - <dt>{{jsxref("String.prototype.blink()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("blink")}}</dd> - <dt>{{jsxref("String.prototype.bold()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("b")}}</dd> - <dt>{{jsxref("String.prototype.fixed()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("tt")}}</dd> - <dt>{{jsxref("String.prototype.fontcolor()")}} {{deprecated_inline}}</dt> - <dd>{{htmlattrxref("color", "font", "<font color=\"color\">")}}</dd> - <dt>{{jsxref("String.prototype.fontsize()")}} {{deprecated_inline}}</dt> - <dd>{{htmlattrxref("size", "font", "<font size=\"size\">")}}</dd> - <dt>{{jsxref("String.prototype.italics()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("i")}}</dd> - <dt>{{jsxref("String.prototype.link()")}}</dt> - <dd>{{htmlattrxref("href", "a", "<a href=\"url\">")}} (link to URL)</dd> - <dt>{{jsxref("String.prototype.small()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("small")}}</dd> - <dt>{{jsxref("String.prototype.strike()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("strike")}}</dd> - <dt>{{jsxref("String.prototype.sub()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("sub")}}</dd> - <dt>{{jsxref("String.prototype.sup()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("sup")}}</dd> -</dl> - -<h2 id="Specifications">Specifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Initial definition.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.5.3.1', 'String.prototype')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.prototype', 'String.prototype')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-string.prototype', 'String.prototype')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> - -<p>{{Compat("javascript.builtins.String.prototype")}}</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li>{{jsxref("String")}}</li> - <li>{{jsxref("Function.prototype")}}</li> -</ul> |