colobot-data/help/cbot/F/strfind.txt

21 lines
876 B
Plaintext
Raw Normal View History

\b;Instruction \c;strfind\n;
2013-10-10 14:10:20 +00:00
Cette instruction cherche une sous-chaîne dans une chaîne et retourne la position du début de la sous-chaîne.
2013-10-10 14:10:20 +00:00
Syntaxe:
\s;\c;strfind ( string, sub );\n;
\t;string: \c;\l;string\u cbot\string;\n;
2013-10-10 14:10:20 +00:00
Chaîne dans laquelle on effectue la recherche.
\t;sub: \c;\l;string\u cbot\string;\n;
2013-10-10 14:10:20 +00:00
Sous-chaîne recherchée.
2013-10-10 14:10:20 +00:00
Exemples:
\s;\c; int pos = strfind("abcdef", "ab"); // pos vaut 0
\s; int pos = strfind("abcdef", "de"); // pos vaut 3
\s; int pos = strfind("abcdef", "xy"); // pos vaut \l;nan\u cbot\nan;
\n;
2013-10-10 14:10:20 +00:00
\t;Voir aussi
\c;\l;strlen\u cbot\strlen;\n;, \c;\l;strleft\u cbot\strleft;\n;, \c;\l;strright\u cbot\strright;\n;, \c;\l;strmid\u cbot\strmid;\n;, \c;\l;strval\u cbot\strval;\n;, \c;\l;strupper\u cbot\strupper;\n;, \c;\l;strlower\u cbot\strlower;\n;
2013-10-10 14:10:20 +00:00
\l;Programmation\u cbot;, \l;types\u cbot\type; et \l;catégories\u cbot\category;.