aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html
diff options
context:
space:
mode:
authorjulieng <julien.gattelier@gmail.com>2021-08-03 08:03:09 +0200
committerSphinxKnight <SphinxKnight@users.noreply.github.com>2021-09-03 08:08:25 +0200
commit844f5103992238c0c23203286dad16a466e89c97 (patch)
treed537708951bb2b61be8192ffacc05a0ce6804f89 /files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html
parenta70fd5b73ecb10bec3906640023e2a1a46e118a2 (diff)
downloadtranslated-content-844f5103992238c0c23203286dad16a466e89c97.tar.gz
translated-content-844f5103992238c0c23203286dad16a466e89c97.tar.bz2
translated-content-844f5103992238c0c23203286dad16a466e89c97.zip
move *.html to *.md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html')
-rw-r--r--files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html122
1 files changed, 0 insertions, 122 deletions
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
deleted file mode 100644
index fc5c35bb08..0000000000
--- a/files/fr/web/javascript/reference/global_objects/string/lastindexof/index.html
+++ /dev/null
@@ -1,122 +0,0 @@
----
-title: String.prototype.lastIndexOf()
-slug: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
-tags:
- - JavaScript
- - Méthode
- - Prototype
- - Reference
- - String
-translation_of: Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
-original_slug: Web/JavaScript/Reference/Objets_globaux/String/lastIndexOf
----
-<div>{{JSRef}}</div>
-
-<p>La méthode <strong><code>lastIndexOf()</code></strong> renvoie l'indice, dans la chaîne courante, de la dernière occurence de la valeur donnée en argument. Si cette sous-chaîne n'est pas trouvée, la méthode renvoie -1. La recherche s'effectue de la fin vers le début de la chaîne, à partir de <code>indiceDébut</code>.</p>
-
-<div>{{EmbedInteractiveExample("pages/js/string-lastindexof.html")}}</div>
-
-<h2 id="Syntaxe">Syntaxe</h2>
-
-<pre class="syntaxbox notranslate"><var>str</var>.lastIndexOf(<var>valeurRecherchée</var>[, <var>indiceDébut</var>])</pre>
-
-<h3 id="Paramètres">Paramètres</h3>
-
-<dl>
- <dt><code>valeurRecherchée</code></dt>
- <dd>Une chaîne qu'on recherche dans la chaîne courante. Si ce paramètre n'est pas défini et que <code>indiceDébut</code> est utilisé, c'est ce dernier qui sera renvoyé par la fonction.</dd>
- <dt><code>indiceDébut </code>{{optional_inline}}</dt>
- <dd>Paramètre optionnel. L'emplacement, dans la chaîne courante, à partir duquel effectuer la recherche (en partant de la fin de la chaîne et en remontant vers le début). Cela peut être n'importe quel entier. La valeur par défaut est <code>+Infinity</code>. Si<code> indiceDébut &gt; str.length</code>, toute la chaîne sera parcourue. Si <code>indiceDébut &lt; 0</code>,  on aura le même comportement que si <code>indiceDébut</code> valait 0.</dd>
-</dl>
-
-<h3 id="Valeur_de_retour">Valeur de retour</h3>
-
-<p>L'indice de la dernière occurrence de la valeur indiquée, <code>-1</code> si elle n'est pas trouvée.</p>
-
-<h2 id="Description">Description</h2>
-
-<p>Les caractères d'une chaîne de caractères sont indexés de gauche à droite. L'indice du premier caractère vaut 0 et l'indice du dernier caractère vaut <code>maChaîne.length - 1</code>.</p>
-
-<pre class="brush: js notranslate">'canal'.lastIndexOf('a');     // renvoie 3
-'canal'.lastIndexOf('a', 2);  // renvoie 1
-'canal'.lastIndexOf('a', 0);  // renvoie -1
-'canal'.lastIndexOf('x');     // renvoie -1
-'canal'.lastIndexOf('c', -5); // renvoie 0
-'canal'.lastIndexOf('c', 0);  // renvoie 0
-'canal'.lastIndexOf('');      // renvoie 5
-'canal'.lastIndexOf('', 2);   // renvoie 2
-</pre>
-
-<div class="note">
-<p><strong>Note :</strong> <code>'abab'.lastIndexOf('ab', 2)</code> renvoie <code>2</code> et pas <code>0</code> car l'argument <code>indiceDébut</code> ne limite que le début de la correspondance recherchée ( qui est <code>'ab'</code>)</p>
-</div>
-
-<h3 id="Sensibilité_à_la_casse">Sensibilité à la casse</h3>
-
-<p>La méthode <code>lastIndexOf()</code> est sensible à la casse (une lettre en minuscule (i) est différente d'une lettre en majuscule (I)). Ainsi, le résultat de l'expression suivante sera -1 :</p>
-
-<pre class="brush: js notranslate">'Blue Whale, Killer Whale'.lastIndexOf('blue'); // renvoie -1
-</pre>
-
-<h2 id="Exemples">Exemples</h2>
-
-<p>Dans l'exemple suivant, on utilise {{jsxref("String.prototype.indexOf()", "indexOf()")}} et <code>lastIndexOf()</code> pour situer certaines valeurs dans la chaîne <code>"Brave new world"</code>.</p>
-
-<pre class="brush: js notranslate">var maChaîne = 'Brave new world';
-
-console.log('Indice du premier w ' + maChaîne.indexOf('w'));
-// Affiche 8
-console.log('Indice du dernier w ' + maChaîne.lastIndexOf('w'));
-// Affiche 10
-
-console.log('Indice du premier "new" ' + maChaîne.indexOf('new'));
-// Affiche 6
-console.log('Indice du dernier "new" ' + maChaîne.lastIndexOf('new'));
-// Affiche 6
-</pre>
-
-<h2 id="Spécifications">Spécifications</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Spécification</th>
- <th scope="col">État</th>
- <th scope="col">Commentaires</th>
- </tr>
- <tr>
- <td>{{SpecName('ES1')}}</td>
- <td>{{Spec2('ES1')}}</td>
- <td>Définition initiale.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-15.5.4.8', 'String.prototype.lastIndexOf')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-string.prototype.lastindexof', 'String.prototype.lastIndexOf')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-string.prototype.lastindexof', 'String.prototype.lastIndexOf')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
-
-<p>{{Compat("javascript.builtins.String.lastIndexOf")}}</p>
-
-<h2 id="Voir_aussi">Voir aussi</h2>
-
-<ul>
- <li>{{jsxref("String.prototype.charAt()")}}</li>
- <li>{{jsxref("String.prototype.indexOf()")}}</li>
- <li>{{jsxref("String.prototype.split()")}}</li>
- <li>{{jsxref("Array.prototype.indexOf()")}}</li>
- <li>{{jsxref("Array.prototype.lastIndexOf()")}}</li>
-</ul>