StrFind

Qubes 6.8 Cherche une sous-chaîne dans une chaîne

Syntaxe

function StrFind(str: String; subStr: String; fromIndex: Integer = 1): Integer
helper IndexOf
str: chaîne où la recherche à lieu
subStr: sous-chaîne à chercher
fromIndex: index de départ pour la recherche

Remarques

Retorune une valeur négative ou nulle si la sous-chaîne n'est pas présente.

Voir aussi PosEx et StrContains.

Exemples

PrintLn( StrFind('banane', 'an') ); // 2
PrintLn( StrFind('banane', 'an', 3) ); // 4

var s := 'banane';
PrintLn( s.IndexOf('an') ); // 2
PrintLn( s.IndexOf('an', 3) ); // 4
PrintLn( s.IndexOf('zz') ); // 0
 

Classification

Internal