diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
| commit | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch) | |
| tree | d4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/de/web/javascript/reference/global_objects/string/fromcharcode | |
| parent | 33058f2b292b3a581333bdfb21b8f671898c5060 (diff) | |
| download | translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2 translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip | |
initial commit
Diffstat (limited to 'files/de/web/javascript/reference/global_objects/string/fromcharcode')
| -rw-r--r-- | files/de/web/javascript/reference/global_objects/string/fromcharcode/index.html | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/files/de/web/javascript/reference/global_objects/string/fromcharcode/index.html b/files/de/web/javascript/reference/global_objects/string/fromcharcode/index.html new file mode 100644 index 0000000000..1ddc144e28 --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/string/fromcharcode/index.html @@ -0,0 +1,134 @@ +--- +title: String.fromCharCode() +slug: Web/JavaScript/Reference/Global_Objects/String/fromCharCode +translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCharCode +--- +<div>{{JSRef}}</div> + +<p>Die statische Methode <strong><code>String.fromCharCode()</code></strong> gibt einen String zurück, der mit der angegebenen Folge von Unicode-Zeichen erstellt wurde.</p> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox"><code>String.fromCharCode(<var>num1</var>[, ...[, <var>numN</var>]])</code></pre> + +<h3 id="Parameters">Parameters</h3> + +<dl> + <dt><code>num1, ..., num<em>N</em></code></dt> + <dd>Eine Folge von Zahlen als Unicode-Werte. Der Wertebreich liegt zwischen 0 und 65535 (0xFFFF). Zahlen, welche größer als 0xFFFF sind werden gekürzt.</dd> +</dl> + +<h3 id="Rückgabewert">Rückgabewert</h3> + +<p>Ein String, der die den Unicode-Werten zugeordneten Zeichen enthält.</p> + +<h2 id="Beschreibung">Beschreibung</h2> + +<p>Diese Methode gibt einen String zurück und kein {{jsxref("String")}} Objekt.</p> + +<p>Da <code>fromCharCode()</code> eine statische Methode von {{jsxref("String")}} ist, wird sie immer als <code>String.fromCharCode() </code>angewandt und nicht als Methode eines {{jsxref("String")}} Objekts, das erstellt wurde.</p> + +<h2 id="Beispiele">Beispiele</h2> + +<h3 id="Verwendung_von_fromCharCode()">Verwendung von <code>fromCharCode()</code></h3> + +<pre>String.fromCharCode(65, 66, 67); // gibt "ABC" zurück +String.fromCharCode(0x2014); // gibt "—" zurück +String.fromCharCode(0x12014); // gibt auch "—" zurück. Die Ziffer 1 wird weggekürzt und ignoriert.</pre> + +<h2 id="Verwendung_mit_höheren_Werten">Verwendung mit höheren Werten</h2> + +<p>Die meisten Unicode-Werte können mit einer 16-bit-Nummer dargestellt werden (wie in den Anfängen der JavaScript-Standardisierung erwartet) und <code>fromCharCode()</code> kann verwendet werden, um ein einzelnes Zeichen für die meisten gängigen Werde (d.h. UCS-2 Werte, die ein Subset von UTF-16 mit den am häufigsten vorkommenden Zeichen bilden) darzustellen. Um jedoch ALLE gültigen Unicode-Werte (bis zu 21 bits) darzustellen, ist <code>fromCharCode()</code> allein nicht ausreichend. Da die höheren Code Point Zeichen zwei "Ersatznummern" (mit niedrigerem Wert) verwenden, um ein einzelnes Zeichen darzustellen, kann {{jsxref("String.fromCodePoint()")}} (Teil des ES2015 Standards) verwendet werden, um ein solches Paar und damit auch diese Zeichen mit höheren Werten darzustellen.</p> + +<h2 id="Spezifikationen">Spezifikationen</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Spezifikation</th> + <th scope="col">Status</th> + <th scope="col">Kommentar</th> + </tr> + <tr> + <td>{{SpecName('ES1')}}</td> + <td>{{Spec2('ES1')}}</td> + <td>Erstdefinition. Implementiert in JavaScript 1.2.</td> + </tr> + <tr> + <td>{{SpecName('ES5.1', '#sec-15.5.3.2', 'StringfromCharCode')}}</td> + <td>{{Spec2('ES5.1')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-string.fromcharcodes', 'String.fromCharCode')}}</td> + <td>{{Spec2('ES6')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-string.fromcharcodes', 'String.fromCharCode')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Browser-Kompatibilität">Browser-Kompatibilität</h2> + +<div>{{CompatibilityTable}}</div> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="Siehe_auch">Siehe auch</h2> + +<ul> + <li>{{jsxref("String.fromCodePoint()")}}</li> + <li>{{jsxref("String.prototype.charAt()")}}</li> + <li>{{jsxref("String.prototype.charCodeAt()")}}</li> + <li>{{jsxref("String.prototype.codePointAt()")}}</li> +</ul> |
