Earth Engine a introduit des
niveaux de quota non commerciaux pour protéger les ressources de calcul partagées et garantir des performances fiables pour tous. Les projets non commerciaux utilisent le niveau "Communauté" par défaut, mais vous pouvez modifier le niveau d'un projet à tout moment.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
ee.String.rindex
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Recherche la dernière occurrence d'une sous-chaîne dans une chaîne. Renvoie l'index de la première correspondance ou -1.
| Utilisation | Renvoie |
|---|
String.rindex(pattern) | Nombre entier |
| Argument | Type | Détails |
|---|
ceci : target | Chaîne | Chaîne à rechercher. |
pattern | Chaîne | Chaîne à rechercher. |
Exemples
Éditeur de code (JavaScript)
print(ee.String('aBc-Abc').rindex('A')); // 4
print(ee.String('aBc-Abc').rindex('a')); // 0
print(ee.String('aBc-Abc').rindex('Bc')); // 1
print(ee.String('aBc-Abc').rindex('Z')); // -1
print(ee.String('aBc-Abc').rindex('-')); // 3
print(ee.String('aBc-Abc').rindex('')); // 7
Configuration de Python
Consultez la page
Environnement Python pour en savoir plus sur l'API Python et sur l'utilisation de geemap pour le développement interactif.
import ee
import geemap.core as geemap
Colab (Python)
display(ee.String('aBc-Abc').rindex('A')) # 4
display(ee.String('aBc-Abc').rindex('a')) # 0
display(ee.String('aBc-Abc').rindex('Bc')) # 1
display(ee.String('aBc-Abc').rindex('Z')) # -1
display(ee.String('aBc-Abc').rindex('-')) # 3
display(ee.String('aBc-Abc').rindex('')) # 7
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/10/30 (UTC).
[null,null,["Dernière mise à jour le 2025/10/30 (UTC)."],[],["The `rindex` function searches a target string for the last occurrence of a specified substring (`pattern`). It returns an integer representing the index of the first character of the last match, or -1 if the substring is not found. If the pattern is an empty string, it returns the length of the string. The function is used as `String.rindex(pattern)`. Examples show it working on various substrings with JavaScript and Python.\n"]]