From 2a76c37d0e733dedf8ed87d1e7e46caf3c44667e Mon Sep 17 00:00:00 2001 From: SphinxKnight Date: Fri, 30 Jul 2021 20:18:17 +0200 Subject: Prepare JS French section for Markdown (#1574) * Rm IDs w/ [^h\d] id=" * Remove class="hidden" * Remove hidden for code blocks * rm summary classes * Use Note consistently * Remove sup * Rm code in pre * Fixes dd/dt/dl * Fix some more dd * Remove inline style and useless/craft from span/font * h2m report fixing - Consistent use of notes * h2m report fixing - Consistent use of warnings * h2m report fixing - reword one callout * h2m report fixing - array cruft spans hell * Cleaning the rest of docs for md conversion --- .../global_objects/string/@@iterator/index.html | 2 -- .../reference/global_objects/string/big/index.html | 2 +- .../reference/global_objects/string/blink/index.html | 2 +- .../reference/global_objects/string/charat/index.html | 2 -- .../global_objects/string/charcodeat/index.html | 2 +- .../global_objects/string/codepointat/index.html | 2 -- .../reference/global_objects/string/concat/index.html | 2 -- .../reference/global_objects/string/endswith/index.html | 2 -- .../reference/global_objects/string/fontsize/index.html | 2 +- .../global_objects/string/fromcharcode/index.html | 2 -- .../global_objects/string/fromcodepoint/index.html | 2 -- .../reference/global_objects/string/includes/index.html | 4 +--- .../reference/global_objects/string/indexof/index.html | 2 +- .../global_objects/string/lastindexof/index.html | 6 ++---- .../reference/global_objects/string/length/index.html | 4 +--- .../global_objects/string/localecompare/index.html | 2 +- .../reference/global_objects/string/match/index.html | 2 -- .../reference/global_objects/string/matchall/index.html | 2 -- .../reference/global_objects/string/normalize/index.html | 2 -- .../reference/global_objects/string/padend/index.html | 2 -- .../reference/global_objects/string/padstart/index.html | 2 -- .../reference/global_objects/string/raw/index.html | 2 -- .../reference/global_objects/string/repeat/index.html | 2 -- .../reference/global_objects/string/replace/index.html | 8 +++----- .../global_objects/string/replaceall/index.html | 2 +- .../reference/global_objects/string/search/index.html | 2 -- .../reference/global_objects/string/slice/index.html | 2 -- .../reference/global_objects/string/split/index.html | 16 +++++++--------- .../global_objects/string/startswith/index.html | 2 -- .../reference/global_objects/string/substr/index.html | 4 +--- .../reference/global_objects/string/substring/index.html | 2 -- .../global_objects/string/tolocalelowercase/index.html | 2 -- .../global_objects/string/tolocaleuppercase/index.html | 2 -- .../global_objects/string/tolowercase/index.html | 2 -- .../reference/global_objects/string/tostring/index.html | 2 +- .../global_objects/string/touppercase/index.html | 4 +--- .../reference/global_objects/string/trim/index.html | 2 -- .../reference/global_objects/string/trimend/index.html | 4 +--- .../reference/global_objects/string/trimstart/index.html | 4 +--- .../reference/global_objects/string/valueof/index.html | 2 -- 40 files changed, 26 insertions(+), 90 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/string') diff --git a/files/fr/web/javascript/reference/global_objects/string/@@iterator/index.html b/files/fr/web/javascript/reference/global_objects/string/@@iterator/index.html index 2399cfb13e..0a01613d9f 100644 --- a/files/fr/web/javascript/reference/global_objects/string/@@iterator/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/@@iterator/index.html @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/@@iterator
{{EmbedInteractiveExample("pages/js/string-iterator.html")}}
- -

Syntaxe

chaîneDeCaractères[Symbol.iterator]
diff --git a/files/fr/web/javascript/reference/global_objects/string/big/index.html b/files/fr/web/javascript/reference/global_objects/string/big/index.html index 0951bbd9ec..0cefdf7fab 100644 --- a/files/fr/web/javascript/reference/global_objects/string/big/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/big/index.html @@ -16,7 +16,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/big

La méthode big() crée un élément HTML {{HTMLElement("big")}} qui affichera la chaine de caractères avec une taille de police importante.

-

Note d'utilisation : L'élément <big> a été retiré de HTML5 et ne doit pas être utilisé. À la place, les développeurs web doivent utiliser les propriétés CSS.

+

Note : L'élément <big> a été retiré de HTML5 et ne doit pas être utilisé. À la place, les développeurs web doivent utiliser les propriétés CSS.

Syntaxe

diff --git a/files/fr/web/javascript/reference/global_objects/string/blink/index.html b/files/fr/web/javascript/reference/global_objects/string/blink/index.html index 70e128169d..a57014d354 100644 --- a/files/fr/web/javascript/reference/global_objects/string/blink/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/blink/index.html @@ -16,7 +16,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/blink

La méthode blink() crée un élément HTML {{HTMLElement("blink")}} qui affiche la chaine de caractères en clignotant.

-
Avertissement : Les textes clignotants sont fortement déconseillés par de nombreux standards d'accessibilité. L'élément <blink> est lui-même non standard et obsolète !
+

Attention : Les textes clignotants sont fortement déconseillés par de nombreux standards d'accessibilité. L'élément <blink> est lui-même non standard et obsolète !

Syntaxe

diff --git a/files/fr/web/javascript/reference/global_objects/string/charat/index.html b/files/fr/web/javascript/reference/global_objects/string/charat/index.html index 8939203047..63e8e2d422 100644 --- a/files/fr/web/javascript/reference/global_objects/string/charat/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/charat/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/charAt
{{EmbedInteractiveExample("pages/js/string-charat.html")}}
- -

Syntaxe

str.charAt(index)
diff --git a/files/fr/web/javascript/reference/global_objects/string/charcodeat/index.html b/files/fr/web/javascript/reference/global_objects/string/charcodeat/index.html index b2115a0527..3b57bc337a 100644 --- a/files/fr/web/javascript/reference/global_objects/string/charcodeat/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/charcodeat/index.html @@ -16,7 +16,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/charCodeAt
{{EmbedInteractiveExample("pages/js/string-charcodeat.html")}}
- +

Le codet UTF-16 renvoyé correspond au codet Unicode si le caractère peut être représenté sur un seul codet. Si le codet Unicode ne peut pas être représenté sur un seul codet UTF-16 (car sa valeur est supérieure à 0xFFFF), seule la première partie de la paire sera renvoyée. Si vous souhaitez obtenir l'ensemble de la valeur, vous pouvez utiliser la méthode {{jsxref("String.prototype.codePointAt()","codePointAt()")}}.

diff --git a/files/fr/web/javascript/reference/global_objects/string/codepointat/index.html b/files/fr/web/javascript/reference/global_objects/string/codepointat/index.html index 33b010ac29..d461d2917d 100644 --- a/files/fr/web/javascript/reference/global_objects/string/codepointat/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/codepointat/index.html @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/codePointAt
{{EmbedInteractiveExample("pages/js/string-codepointat.html")}}
- -

Syntaxe

str.codePointAt(pos)
diff --git a/files/fr/web/javascript/reference/global_objects/string/concat/index.html b/files/fr/web/javascript/reference/global_objects/string/concat/index.html index 5e3fbc25fd..8958a7491f 100644 --- a/files/fr/web/javascript/reference/global_objects/string/concat/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/concat/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/concat
{{EmbedInteractiveExample("pages/js/string-concat.html")}}
- -

Syntaxe

str.concat(string2[, string3, ..., stringN])
diff --git a/files/fr/web/javascript/reference/global_objects/string/endswith/index.html b/files/fr/web/javascript/reference/global_objects/string/endswith/index.html index 84d25dcf35..170935fb6e 100644 --- a/files/fr/web/javascript/reference/global_objects/string/endswith/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/endswith/index.html @@ -17,8 +17,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/endsWith
{{EmbedInteractiveExample("pages/js/string-endswith.html")}}
- -

Syntaxe

str.endsWith(chaîneRecherchée[, position]);
diff --git a/files/fr/web/javascript/reference/global_objects/string/fontsize/index.html b/files/fr/web/javascript/reference/global_objects/string/fontsize/index.html index df134dbfbb..72aca87a1a 100644 --- a/files/fr/web/javascript/reference/global_objects/string/fontsize/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/fontsize/index.html @@ -17,7 +17,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/fontsize

La propriété fontsize() permet de créer un élément HTML {{HTMLElement("font")}} qui permet d'afficher la chaîne de caractères dans une fonte de taille donnée.

-

Note : L'élément <font> a été retiré dans HTML5 et ne devrait plus être utilisé. Les propriétés CSS permettent de modifier les aspects de mise en forme et doivent donc être utilisées à la place.

+

Note : L'élément <font> a été retiré dans HTML5 et ne devrait plus être utilisé. Les propriétés CSS permettent de modifier les aspects de mise en forme et doivent donc être utilisées à la place.

Syntaxe

diff --git a/files/fr/web/javascript/reference/global_objects/string/fromcharcode/index.html b/files/fr/web/javascript/reference/global_objects/string/fromcharcode/index.html index 3704386954..975eb23fb0 100644 --- a/files/fr/web/javascript/reference/global_objects/string/fromcharcode/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/fromcharcode/index.html @@ -17,8 +17,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/fromCharCode
{{EmbedInteractiveExample("pages/js/string-fromcharcode.html")}}
- -

Syntaxe

String.fromCharCode(num1, ..., numN)
diff --git a/files/fr/web/javascript/reference/global_objects/string/fromcodepoint/index.html b/files/fr/web/javascript/reference/global_objects/string/fromcodepoint/index.html index 0a2b117bc7..81cf698e35 100644 --- a/files/fr/web/javascript/reference/global_objects/string/fromcodepoint/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/fromcodepoint/index.html @@ -17,8 +17,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/fromCodePoint
{{EmbedInteractiveExample("pages/js/string-fromcodepoint.html")}}
- -

Syntaxe

String.fromCodePoint(num1[, ...[, numN]])
diff --git a/files/fr/web/javascript/reference/global_objects/string/includes/index.html b/files/fr/web/javascript/reference/global_objects/string/includes/index.html index 3c8fe25fca..e3aba75116 100644 --- a/files/fr/web/javascript/reference/global_objects/string/includes/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/includes/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/includes
{{EmbedInteractiveExample("pages/js/string-includes.html")}}
- -

Syntaxe

str.includes(chaîneRecherchée);
@@ -60,7 +58,7 @@ console.log(str.includes("ÊTRE"));       // false
 console.log(str.includes(""));       // true
 
-

Prothèse d'émulation (polyfill)

+

Prothèse d'émulation (polyfill)

Cette méthode a été ajoutée à la spécification ECMAScript 2015 et n'est peut-être pas encore disponible dans toutes les implémentations JavaScript.

diff --git a/files/fr/web/javascript/reference/global_objects/string/indexof/index.html b/files/fr/web/javascript/reference/global_objects/string/indexof/index.html index 589b59fae3..69a0303542 100644 --- a/files/fr/web/javascript/reference/global_objects/string/indexof/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/indexof/index.html @@ -16,7 +16,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/indexOf
{{EmbedInteractiveExample("pages/js/string-indexof.html")}}
- +

Note : Pour la méthode associée aux tableaux, voir la page {{jsxref("Array.prototype.indexOf()")}}.

diff --git a/files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html b/files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html index 468a2411c6..fc5c35bb08 100644 --- a/files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/lastIndexOf
{{EmbedInteractiveExample("pages/js/string-lastindexof.html")}}
- -

Syntaxe

str.lastIndexOf(valeurRecherchée[, indiceDébut])
@@ -49,8 +47,8 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/lastIndexOf 'canal'.lastIndexOf('', 2);   // renvoie 2 -
-

Note : 'abab'.lastIndexOf('ab', 2) renvoie 2 et pas 0 car l'argument indiceDébut ne limite que le début de la correspondance recherchée ( qui est 'ab')

+
+

Note : 'abab'.lastIndexOf('ab', 2) renvoie 2 et pas 0 car l'argument indiceDébut ne limite que le début de la correspondance recherchée ( qui est 'ab')

Sensibilité à la casse

diff --git a/files/fr/web/javascript/reference/global_objects/string/length/index.html b/files/fr/web/javascript/reference/global_objects/string/length/index.html index 091bcbc8b1..d3f3f49913 100644 --- a/files/fr/web/javascript/reference/global_objects/string/length/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/length/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/length
{{EmbedInteractiveExample("pages/js/string-length.html")}}
- -

Syntaxe

str.length
@@ -26,7 +24,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/length

Cette propriété renvoie le nombre de « codets » (ou unités de code ou bien code units en anglais) d'une chaîne de caractères. {{interwiki("wikipedia", "UTF-16")}}. Le format utilisé pour représenter les chaînes de caractères en JavaScript utilise un seul codet sur 16 bits pour représenter la plupart des caractères communs. En revanche, pour représenter les caractères plus rares, deux codets seront utilisés : la valeur renvoyée par length ne correspondra alors pas au nombre de caractères dans la chaîne.

-

ECMAScript 2016 (la septième édition) établit une longueur maximale de 253 - 1 éléments. Auparavant, aucune longueur maximale n'était spécifiée. Pour Firefox, les chaînes ont une longueur maximale de 230-2 caractères (environ 1 Go). Pour les versions de Firefox antérieures à Firefox 65, la taille maximale était de de 228-1 (environ 256 Mo).

+

ECMAScript 2016 (la septième édition) établit une longueur maximale de 2^53 - 1 éléments. Auparavant, aucune longueur maximale n'était spécifiée. Pour Firefox, les chaînes ont une longueur maximale de 2^30-2 caractères (environ 1 Go). Pour les versions de Firefox antérieures à Firefox 65, la taille maximale était de de 2^28-1 (environ 256 Mo).

Pour une chaine vide, on aura length égal à 0.

diff --git a/files/fr/web/javascript/reference/global_objects/string/localecompare/index.html b/files/fr/web/javascript/reference/global_objects/string/localecompare/index.html index e5c74ef100..2b84d90be0 100644 --- a/files/fr/web/javascript/reference/global_objects/string/localecompare/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/localecompare/index.html @@ -17,7 +17,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/localeCompare
{{EmbedInteractiveExample("pages/js/string-localecompare.html")}}
- +

Les arguments locales et options permettent de définir la locale et des options pour adapter le comportement de la fonction. Les anciennes implémentations ignoreront les arguments locales et options. L'ordre de tri utilisé sera entièrement dépendant de l'implémentation.

diff --git a/files/fr/web/javascript/reference/global_objects/string/match/index.html b/files/fr/web/javascript/reference/global_objects/string/match/index.html index ac29c3772e..27d3d04e85 100644 --- a/files/fr/web/javascript/reference/global_objects/string/match/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/match/index.html @@ -17,8 +17,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/match
{{EmbedInteractiveExample("pages/js/string-match.html")}}
- -

Syntaxe

str.match(regexp)
diff --git a/files/fr/web/javascript/reference/global_objects/string/matchall/index.html b/files/fr/web/javascript/reference/global_objects/string/matchall/index.html index 5ac0de5bad..5b9e8b50c9 100644 --- a/files/fr/web/javascript/reference/global_objects/string/matchall/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/matchall/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/matchAll
{{EmbedInteractiveExample("pages/js/string-matchall.html")}}
- -

Syntaxe

str.matchAll(regexp)
diff --git a/files/fr/web/javascript/reference/global_objects/string/normalize/index.html b/files/fr/web/javascript/reference/global_objects/string/normalize/index.html index 1b60ab94c9..b35ff15f8b 100644 --- a/files/fr/web/javascript/reference/global_objects/string/normalize/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/normalize/index.html @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/normalize
{{EmbedInteractiveExample("pages/js/string-normalize.html")}}
- -

Syntaxe

str.normalize([form]);
diff --git a/files/fr/web/javascript/reference/global_objects/string/padend/index.html b/files/fr/web/javascript/reference/global_objects/string/padend/index.html index 735dbedb94..2039f7be3c 100644 --- a/files/fr/web/javascript/reference/global_objects/string/padend/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/padend/index.html @@ -15,8 +15,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/padEnd
{{EmbedInteractiveExample("pages/js/string-padend.html")}}
- -

Syntaxe

str.padEnd(longueurCible [, chaîneComplémentaire])
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 index 607d0ae192..85ecc07e2d 100644 --- a/files/fr/web/javascript/reference/global_objects/string/padstart/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/padstart/index.html @@ -15,8 +15,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/padStart
{{EmbedInteractiveExample("pages/js/string-padstart.html")}}
- -

Syntaxe

str.padStart(longueurCible [, chaîneComplémentaire])
diff --git a/files/fr/web/javascript/reference/global_objects/string/raw/index.html b/files/fr/web/javascript/reference/global_objects/string/raw/index.html index cef5df163a..9a9724ffc9 100644 --- a/files/fr/web/javascript/reference/global_objects/string/raw/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/raw/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/raw
{{EmbedInteractiveExample("pages/js/string-raw.html")}}
- -

Syntaxe

String.raw(callSite, ...substitutions)
diff --git a/files/fr/web/javascript/reference/global_objects/string/repeat/index.html b/files/fr/web/javascript/reference/global_objects/string/repeat/index.html
index 28d76c3930..77600fdf96 100644
--- a/files/fr/web/javascript/reference/global_objects/string/repeat/index.html
+++ b/files/fr/web/javascript/reference/global_objects/string/repeat/index.html
@@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/repeat
 
 
{{EmbedInteractiveExample("pages/js/string-repeat.html")}}
- -

Syntaxe

str.repeat(compte)
diff --git a/files/fr/web/javascript/reference/global_objects/string/replace/index.html b/files/fr/web/javascript/reference/global_objects/string/replace/index.html index 73dd09d1a7..38e5c691d0 100644 --- a/files/fr/web/javascript/reference/global_objects/string/replace/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/replace/index.html @@ -20,8 +20,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/replace
{{EmbedInteractiveExample("pages/js/string-replace.html")}}
- -

Syntaxe

chn.replace(regexp|souschn, nouvSouschn|fonction)
@@ -141,8 +139,8 @@ console.log(nouvChn); // Twas the night before Christmas...

Cela affiche 'Twas the night before Christmas...'.

-
-

Note : Voir ce guide pour plus d'explications concernant les expressions régulières.

+
+

Note : Voir ce guide pour plus d'explications concernant les expressions régulières.

Utilisation de global et ignore avec replace()

@@ -225,7 +223,7 @@ x_x_x___x___x___
-
Un tableau d'objets. Un 'x' dénote un état 'marche', un '-' symbolise un état 'arret' et un  '_' (blanc souligné) symbolise la longueur d'un état 'marche'.
+
Un tableau d'objets. Un 'x' dénote un état 'marche', un '-' symbolise un état 'arret' et un  '_' (blanc souligné) symbolise la longueur d'un état 'marche'.
diff --git a/files/fr/web/javascript/reference/global_objects/string/replaceall/index.html b/files/fr/web/javascript/reference/global_objects/string/replaceall/index.html index 38a0e849e1..c06b93eca3 100644 --- a/files/fr/web/javascript/reference/global_objects/string/replaceall/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/replaceall/index.html @@ -6,7 +6,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/replaceAll ---
{{JSRef}}
-

La méthode replaceAll() retourne une nouvelle chaîne de caractères dans laquelle toutes les occurrences d'un motif donné ont été remplacées par une chaîne de remplacement. L'argument pattern fournit pour décrire le motif peut être une chaîne de caractères ou une expression rationnelle (RegExp), l'argument replacement peut être une chaîne de caractères ou une fonction qui sera appelée pour chaque correspondance.

+

La méthode replaceAll() retourne une nouvelle chaîne de caractères dans laquelle toutes les occurrences d'un motif donné ont été remplacées par une chaîne de remplacement. L'argument pattern fournit pour décrire le motif peut être une chaîne de caractères ou une expression rationnelle (RegExp), l'argument replacement peut être une chaîne de caractères ou une fonction qui sera appelée pour chaque correspondance.

La chaîne de caractères initiale restera inchangée.

diff --git a/files/fr/web/javascript/reference/global_objects/string/search/index.html b/files/fr/web/javascript/reference/global_objects/string/search/index.html index e8796fc2bb..aa1828528f 100644 --- a/files/fr/web/javascript/reference/global_objects/string/search/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/search/index.html @@ -17,8 +17,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/search
{{EmbedInteractiveExample("pages/js/string-search.html")}}
- -

Syntaxe

str.search(regexp)
diff --git a/files/fr/web/javascript/reference/global_objects/string/slice/index.html b/files/fr/web/javascript/reference/global_objects/string/slice/index.html index 6413ab7e82..a43faa2bd1 100644 --- a/files/fr/web/javascript/reference/global_objects/string/slice/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/slice/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/slice
{{EmbedInteractiveExample("pages/js/string-slice.html")}}
- -

Syntaxe

chn.slice(indiceDebut[, indiceFin])
diff --git a/files/fr/web/javascript/reference/global_objects/string/split/index.html b/files/fr/web/javascript/reference/global_objects/string/split/index.html index 1501e82a17..208f978a7d 100644 --- a/files/fr/web/javascript/reference/global_objects/string/split/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/split/index.html @@ -24,7 +24,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/split

Paramètres

-
separator Facultatif
+
separator Facultatif

Le motif décrivant où chaque séparation doit se produire. Le separator peut être une simple chaîne de caractères ou peut être une expression régulière.

@@ -36,12 +36,11 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/split
  • Si separator est une chaîne vide (""), la chaîne str est convertie en un tableau de chacun de ses "caractères" UTF-16.
  • -
    -

    Attention :

    -

    Lorsque une chaîne vide ("") est utilisée comme séparateur, la chaîne n'est pas divisée par des caractères perçus par l'utilisateur (grappes de graphèmes) ou des caractères unicodes (codepoints), mais par des unités de code UTF-16. Cela détruit les paires de substituts. Voir « Comment obtenir une chaîne de caractères vers un tableau de caractères en JavaScript ? » sur StackOverflow.

    +
    +

    Attention : Lorsque une chaîne vide ("") est utilisée comme séparateur, la chaîne n'est pas divisée par des caractères perçus par l'utilisateur (grappes de graphèmes) ou des caractères unicodes (codepoints), mais par des unités de code UTF-16. Cela détruit les paires de substituts. Voir « Comment obtenir une chaîne de caractères vers un tableau de caractères en JavaScript ? » sur StackOverflow.

    -
    limit Facultatif
    +
    limit Facultatif

    Un nombre entier non négatif spécifiant une limite sur le nombre de sous-chaînes à inclure dans le tableau. S'il est fourni, il divise la chaîne de caractères à chaque occurrence du separator spécifié, mais s'arrête lorsque la limit (limite) d'entrées a été atteinte dans le tableau. Tout texte restant n'est pas du tout inclus dans le tableau.

    @@ -157,15 +156,14 @@ console.log(splits);
    [ "Hello ", "1", " word. Sentence number ", "2", "." ]
    -
    -

    Note :

    -

    \d correspond à la classe de caractères pour les chiffres compris entre 0 et 9.

    +
    +

    Note : \d correspond à la classe de caractères pour les chiffres compris entre 0 et 9.

    Inverser une chaîne en utilisant split()

    -

    Ce n'est pas une façon robuste d'inverser une chaîne :

    +

    Attention : Ce n'est pas une façon robuste d'inverser une chaîne :

    const str = 'asdfghjkl'
     const strReverse = str.split('').reverse().join('')
    diff --git a/files/fr/web/javascript/reference/global_objects/string/startswith/index.html b/files/fr/web/javascript/reference/global_objects/string/startswith/index.html
    index 9927a9c24a..6216df303c 100644
    --- a/files/fr/web/javascript/reference/global_objects/string/startswith/index.html
    +++ b/files/fr/web/javascript/reference/global_objects/string/startswith/index.html
    @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/startsWith
     
     
    {{EmbedInteractiveExample("pages/js/string-startswith.html")}}
    - -

    Syntaxe

    str.startsWith(chaîneRecherchée [, position]);
    diff --git a/files/fr/web/javascript/reference/global_objects/string/substr/index.html b/files/fr/web/javascript/reference/global_objects/string/substr/index.html index 7f2ce5237e..9ee8253861 100644 --- a/files/fr/web/javascript/reference/global_objects/string/substr/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/substr/index.html @@ -13,14 +13,12 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/substr ---
    {{JSRef}}
    -
    Attention ! Bien que String.prototype.substr(…) ne soit pas strictement obsolète (au sens où elle n'a pas été retirée des standards), elle est définie au sein de l'Annexe B du standard ECMA-262 qui définit l'ensemble des fonctionnalités historiques qui doivent être évitées autant que possible. On utilisera la méthode {{jsxref("String.prototype.substring()")}} à la place.
    +

    Attention : Bien que String.prototype.substr(…) ne soit pas strictement obsolète (au sens où elle n'a pas été retirée des standards), elle est définie au sein de l'Annexe B du standard ECMA-262 qui définit l'ensemble des fonctionnalités historiques qui doivent être évitées autant que possible. On utilisera la méthode {{jsxref("String.prototype.substring()")}} à la place.

    La méthode substr() retourne la partie d'une chaîne de caractères comprise entre l'indice de départ et un certain nombre de caractères après celui-ci.

    {{EmbedInteractiveExample("pages/js/string-substr.html")}}
    - -

    Syntaxe

    chn.substr(début[, longueur])
    diff --git a/files/fr/web/javascript/reference/global_objects/string/substring/index.html b/files/fr/web/javascript/reference/global_objects/string/substring/index.html index 5fa210e026..df6dc3157c 100644 --- a/files/fr/web/javascript/reference/global_objects/string/substring/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/substring/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/substring
    {{EmbedInteractiveExample("pages/js/string-substring.html")}}
    - -

    Syntaxe

    str.substring(indiceA[, indiceB])
    diff --git a/files/fr/web/javascript/reference/global_objects/string/tolocalelowercase/index.html b/files/fr/web/javascript/reference/global_objects/string/tolocalelowercase/index.html index 35b94603bc..caf1c9c0c8 100644 --- a/files/fr/web/javascript/reference/global_objects/string/tolocalelowercase/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/tolocalelowercase/index.html @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/toLocaleLowerCase
    {{EmbedInteractiveExample("pages/js/string-tolocalelowercase.html")}}
    - -

    Syntaxe

    str.toLocaleLowerCase()
    diff --git a/files/fr/web/javascript/reference/global_objects/string/tolocaleuppercase/index.html b/files/fr/web/javascript/reference/global_objects/string/tolocaleuppercase/index.html
    index d2758e6907..0116ac288d 100644
    --- a/files/fr/web/javascript/reference/global_objects/string/tolocaleuppercase/index.html
    +++ b/files/fr/web/javascript/reference/global_objects/string/tolocaleuppercase/index.html
    @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/toLocaleUpperCase
     
     
    {{EmbedInteractiveExample("pages/js/string-tolocaleuppercase.html")}}
    - -

    Syntaxe

    str.toLocaleUpperCase()
    diff --git a/files/fr/web/javascript/reference/global_objects/string/tolowercase/index.html b/files/fr/web/javascript/reference/global_objects/string/tolowercase/index.html
    index 883d73c77b..88a37a316c 100644
    --- a/files/fr/web/javascript/reference/global_objects/string/tolowercase/index.html
    +++ b/files/fr/web/javascript/reference/global_objects/string/tolowercase/index.html
    @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/toLowerCase
     
     
    {{EmbedInteractiveExample("pages/js/string-tolowercase.html")}}
    - -

    Syntaxe

    str.toLowerCase()
    diff --git a/files/fr/web/javascript/reference/global_objects/string/tostring/index.html b/files/fr/web/javascript/reference/global_objects/string/tostring/index.html index 5c0f6069fc..0cdc5b48b2 100644 --- a/files/fr/web/javascript/reference/global_objects/string/tostring/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/tostring/index.html @@ -14,7 +14,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/toString

    La méthode toString() renvoie une chaine de caractères représentant l'objet renseigné.

    - +
    {{EmbedInteractiveExample("pages/js/string-tostring.html")}}
    diff --git a/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html b/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html index 6db3a185a1..cd9d6b0f9b 100644 --- a/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/toUpperCase
    {{EmbedInteractiveExample("pages/js/string-touppercase.html")}}
    - -

    Syntaxe

    str.toUpperCase()
    @@ -43,7 +41,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/toUpperCase
    console.log( "alphabet".toUpperCase() ); // "ALPHABET"
    -

    Convertir une valeur this en chaîne de caractères

    +

    Convertir une valeur this en chaîne de caractères

    Cette peut être utilisée pour convertir une valeur qui n'est pas une chaîne de caractères lorsque celle-ci est fournie comme valeur this : ​​​​

    diff --git a/files/fr/web/javascript/reference/global_objects/string/trim/index.html b/files/fr/web/javascript/reference/global_objects/string/trim/index.html index 6faa6bfb79..24146f8e6f 100644 --- a/files/fr/web/javascript/reference/global_objects/string/trim/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/trim/index.html @@ -18,8 +18,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/trim
    {{EmbedInteractiveExample("pages/js/string-trim.html")}}
    - -

    Syntaxe

    str.trim()
    diff --git a/files/fr/web/javascript/reference/global_objects/string/trimend/index.html b/files/fr/web/javascript/reference/global_objects/string/trimend/index.html index 479c7687e7..3f3ea377c8 100644 --- a/files/fr/web/javascript/reference/global_objects/string/trimend/index.html +++ b/files/fr/web/javascript/reference/global_objects/string/trimend/index.html @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/trimEnd
    {{EmbedInteractiveExample("pages/js/string-trimend.html")}}
    - -

    Syntaxe

    str.trimEnd();
    @@ -41,7 +39,7 @@ str.trimRight();

    L'exemple qui suit illustre comment afficher la chaîne "   toto":

    -
    var str = "   toto  ";
    +
    var str = "   toto  ";
     
     console.log(str.length); // 9
     
    diff --git a/files/fr/web/javascript/reference/global_objects/string/trimstart/index.html b/files/fr/web/javascript/reference/global_objects/string/trimstart/index.html
    index 8c0927b4a7..fb06eafc08 100644
    --- a/files/fr/web/javascript/reference/global_objects/string/trimstart/index.html
    +++ b/files/fr/web/javascript/reference/global_objects/string/trimstart/index.html
    @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/trimStart
     
     
    {{EmbedInteractiveExample("pages/js/string-trimstart.html")}}
    - -

    Syntaxe

    str.trimStart();
    @@ -41,7 +39,7 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/trimStart
     
     

    L'exemple qui suit illustre comment afficher la chaîne de caractères "toto  " en minuscules :

    -
    var str = "   toto  ";
    +
    var str = "   toto  ";
     
     console.log(str.length); // 8
     
    diff --git a/files/fr/web/javascript/reference/global_objects/string/valueof/index.html b/files/fr/web/javascript/reference/global_objects/string/valueof/index.html
    index cb1fbe1612..edacaf0f0c 100644
    --- a/files/fr/web/javascript/reference/global_objects/string/valueof/index.html
    +++ b/files/fr/web/javascript/reference/global_objects/string/valueof/index.html
    @@ -16,8 +16,6 @@ original_slug: Web/JavaScript/Reference/Objets_globaux/String/valueOf
     
     
    {{EmbedInteractiveExample("pages/js/string-valueof.html")}}
    - -

    Syntaxe

    str.valueOf()
    -- cgit v1.2.3-54-g00ecf