aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/global_objects/string/padstart
diff options
context:
space:
mode:
authorMasahiro FUJIMOTO <mfujimot@gmail.com>2021-09-04 00:46:12 +0900
committerMasahiro FUJIMOTO <mfujimot@gmail.com>2021-09-04 00:46:12 +0900
commitfe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f (patch)
tree51b7edfc370236684a203f4e69ae67bb7d24b549 /files/fr/web/javascript/reference/global_objects/string/padstart
parent04ea4edc83cc12142ed151bbea2c65cffc8e76f6 (diff)
parenteeb07fe338cdc90092841d717919f46f9d9e3ff9 (diff)
downloadtranslated-content-fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f.tar.gz
translated-content-fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f.tar.bz2
translated-content-fe6f6abf2b7c497bf1f97f73a82dde7cf48eb79f.zip
Merge branch 'main' into 20210818-Glossary/Type
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/string/padstart')
-rw-r--r--files/fr/web/javascript/reference/global_objects/string/padstart/index.html75
-rw-r--r--files/fr/web/javascript/reference/global_objects/string/padstart/index.md56
2 files changed, 56 insertions, 75 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/string/padstart/index.html b/files/fr/web/javascript/reference/global_objects/string/padstart/index.html
deleted file mode 100644
index 85ecc07e2d..0000000000
--- a/files/fr/web/javascript/reference/global_objects/string/padstart/index.html
+++ /dev/null
@@ -1,75 +0,0 @@
----
-title: String.prototype.padStart()
-slug: Web/JavaScript/Reference/Global_Objects/String/padStart
-tags:
- - JavaScript
- - Méthode
- - Reference
- - String
-translation_of: Web/JavaScript/Reference/Global_Objects/String/padStart
-original_slug: Web/JavaScript/Reference/Objets_globaux/String/padStart
----
-<div>{{JSRef}}</div>
-
-<p>La méthode <strong><code>padStart()</code></strong> permet de compléter la chaîne courante avec une chaîne de caractères donnée afin d'obtenir une chaîne de longueur fixée. Pour atteindre cette longueur, la chaîne complémentaire peut être répétée. La chaîne courante est complétée depuis le début.</p>
-
-<div>{{EmbedInteractiveExample("pages/js/string-padstart.html")}}</div>
-
-<h2 id="Syntaxe">Syntaxe</h2>
-
-<pre class="syntaxbox"><var>str</var>.padStart(<var>longueurCible</var> [, <var>chaîneComplémentaire</var>])</pre>
-
-<h3 id="Paramètres">Paramètres</h3>
-
-<dl>
- <dt><code>longueurCible</code></dt>
- <dd>La longueur de la chaîne qu'on souhaite obtenir. Si la longueur indiquée est inférieure à celle de la chaîne courante, cette dernière est renvoyée telle quelle.</dd>
- <dt><code>chaîneComplémentaire</code> {{optional_inline}}</dt>
- <dd>La chaîne de caractères avec laquelle on veut compléter la chaîne courante. Si cette chaîne est trop longue, on prendra uniquement le début (la partie la plus à gauche quand la langue s'écrit de gauche à droite). La valeur par défaut de ce paramètre est l'espace " " (U+0020). Si cette chaîne est trop courte, elle sera répétée.</dd>
-</dl>
-
-<h3 id="Valeur_de_retour">Valeur de retour</h3>
-
-<p>Une chaîne de caractères ({{jsxref("String")}}) dont la longueur est celle indiquée, complétée avec la chaîne fournie au début de la chaîne courante.</p>
-
-<h2 id="Exemples">Exemples</h2>
-
-<pre class="brush: js">'abc'.padStart(10); // "        abc"
-'abc'.padStart(10, "toto"); // "totototabc"
-'abc'.padStart(6,"123465"); // "123abc"
-'abc'.padStart(8, "0"); // "00000abc"
-'abc'.padStart(1); // "abc"</pre>
-
-<h2 id="Spécifications">Spécifications</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Spécification</th>
- <th scope="col">État</th>
- <th scope="col">Commentaires</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-string.prototype.padstart', 'String.prototype.padStart')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ES8', '#sec-string.prototype.padstart', 'String.prototype.padStart')}}</td>
- <td>{{Spec2('ES8')}}</td>
- <td>Définition initiale.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
-
-<p>{{Compat("javascript.builtins.String.padStart")}}</p>
-
-<h2 id="Voir_aussi">Voir aussi</h2>
-
-<ul>
- <li>{{jsxref("String.prototype.padEnd()")}}</li>
-</ul>
diff --git a/files/fr/web/javascript/reference/global_objects/string/padstart/index.md b/files/fr/web/javascript/reference/global_objects/string/padstart/index.md
new file mode 100644
index 0000000000..1957a024e6
--- /dev/null
+++ b/files/fr/web/javascript/reference/global_objects/string/padstart/index.md
@@ -0,0 +1,56 @@
+---
+title: String.prototype.padStart()
+slug: Web/JavaScript/Reference/Global_Objects/String/padStart
+tags:
+ - JavaScript
+ - Méthode
+ - Reference
+ - String
+translation_of: Web/JavaScript/Reference/Global_Objects/String/padStart
+original_slug: Web/JavaScript/Reference/Objets_globaux/String/padStart
+---
+{{JSRef}}
+
+La méthode **`padStart()`** permet de compléter la chaîne courante avec une chaîne de caractères donnée afin d'obtenir une chaîne de longueur fixée. Pour atteindre cette longueur, la chaîne complémentaire peut être répétée. La chaîne courante est complétée depuis le début.
+
+{{EmbedInteractiveExample("pages/js/string-padstart.html")}}
+
+## Syntaxe
+
+ str.padStart(longueurCible [, chaîneComplémentaire])
+
+### Paramètres
+
+- `longueurCible`
+ - : La longueur de la chaîne qu'on souhaite obtenir. Si la longueur indiquée est inférieure à celle de la chaîne courante, cette dernière est renvoyée telle quelle.
+- `chaîneComplémentaire` {{optional_inline}}
+ - : La chaîne de caractères avec laquelle on veut compléter la chaîne courante. Si cette chaîne est trop longue, on prendra uniquement le début (la partie la plus à gauche quand la langue s'écrit de gauche à droite). La valeur par défaut de ce paramètre est l'espace " " (U+0020). Si cette chaîne est trop courte, elle sera répétée.
+
+### Valeur de retour
+
+Une chaîne de caractères ({{jsxref("String")}}) dont la longueur est celle indiquée, complétée avec la chaîne fournie au début de la chaîne courante.
+
+## Exemples
+
+```js
+'abc'.padStart(10); // "        abc"
+'abc'.padStart(10, "toto"); // "totototabc"
+'abc'.padStart(6,"123465"); // "123abc"
+'abc'.padStart(8, "0"); // "00000abc"
+'abc'.padStart(1); // "abc"
+```
+
+## Spécifications
+
+| Spécification | État | Commentaires |
+| -------------------------------------------------------------------------------------------------------------------- | ---------------------------- | -------------------- |
+| {{SpecName('ESDraft', '#sec-string.prototype.padstart', 'String.prototype.padStart')}} | {{Spec2('ESDraft')}} | |
+| {{SpecName('ES8', '#sec-string.prototype.padstart', 'String.prototype.padStart')}} | {{Spec2('ES8')}} | Définition initiale. |
+
+## Compatibilité des navigateurs
+
+{{Compat("javascript.builtins.String.padStart")}}
+
+## Voir aussi
+
+- {{jsxref("String.prototype.padEnd()")}}