Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
strings.reverse
strings.reverse(STRING)
Description
Renvoie une chaîne qui est l'inverse de la chaîne d'entrée.
Types de données des paramètres
STRING
Type renvoyé
STRING
Exemples de code
Exemple 1
L'exemple suivant transmet une chaîne courte.
strings.reverse("str") = "rts" // The function returns 'rts'.
Exemple 2
L'exemple suivant transmet une chaîne vide.
strings.reverse("") = ""
Exemple 3
L'exemple suivant transmet un palindrome.
strings.reverse("tacocat") = "tacocat"
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/07/29 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/29 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003estrings.reverse\u003c/code\u003e function reverses the order of characters in a given string.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a single string (\u003ccode\u003eSTRING\u003c/code\u003e) as input and returns a reversed string (\u003ccode\u003eSTRING\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003ePassing an empty string to \u003ccode\u003estrings.reverse\u003c/code\u003e will return an empty string.\u003c/p\u003e\n"],["\u003cp\u003eIf a palindrome is passed to this function it will return the same string.\u003c/p\u003e\n"]]],[],null,["### strings.reverse\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.reverse(STRING)\n\n#### Description\n\nReturns a string that is the reverse of the input string.\n\n#### Param data types\n\n`STRING`\n\n#### Return type\n\n`STRING`\n\n#### Code samples\n\n##### Example 1\n\nThe following example passes a short string. \n\n strings.reverse(\"str\") = \"rts\" // The function returns 'rts'.\n\n##### Example 2\n\nThe following example passes an empty string. \n\n strings.reverse(\"\") = \"\"\n\n##### Example 3\n\nThe following example passes a palindrome. \n\n strings.reverse(\"tacocat\") = \"tacocat\""]]