Aide:StringInStr.txt

De Wiki AutoIt Français
Aller à : navigation, rechercher

Document original V3.3.6.1 :

###Function###
StringInStr

###Description###
Checks if a string contains a given substring.

###Syntax###
StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] )


###Parameters###
@@ParamTable@@
string
	The string to evaluate.
substring
	The substring to search for.
casesense
	[optional] Flag to indicate if the operations should be case sensitive.
	0 = not case sensitive, using the user's locale (default)
	1 = case sensitive
	2 = not case sensitive, using a basic/faster comparison
occurrence
	[optional] Which occurrence of the substring to find in the string.  Use a negative occurrence to search from the right side.  The default value is 1 (finds first occurrence).
start
	[optional] The starting position of the search.
count
	[optional] The number of characters to search.  This effectively limits the search to a portion of the full string.  See remarks.
@@End@@


###ReturnValue###
@@ReturnTable@@
Success:	Returns the position of the substring.
Failure:	Returns 0 if substring not found.

@Error	0 - Normal operation
	1 - Invalid "start" or "occurence" parameter given.
@@End@@


###Remarks###
The first character position is 1.

The count parameter must be longer than the substring being searched for.  The count parameter (combined with the start parameter) effectively limits the search to a substring of the full string.  The following two statements are equivalent:
StringInStr("the string to search", "string", 0, 1, 1, 11)
StringInStr(StringMid("the string to search", 1, 11), "string")

###Related###
StringCompare, StringLeft, StringLen, StringLower, StringMid, StringRight, StringTrimLeft, StringTrimRight, StringUpper, StringRegExp, StringSplit


###Example###
@@IncludeExample@@


Document traduit V3.3.6.1 :

###Function###
StringInStr

###Description###
Vérifie si une chaîne contient une sous-chaîne donnée.


###Syntax###
StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] )


###Parameters###
@@ParamTable@@
string
	La chaîne à vérifier.
substring
	La sous-chaîne à rechercher.
casesense
	[optionnel] Paramètre pour indiquer si les opérations doivent être sensibles à la casse.
	0 = insensible à la casse, utilise les paramètres locaux de l'utilisateur (par défaut)
	1 = sensible à la casse
	2 = insensible à la casse, utilise une comparaison simple/rapide
occurrence
	[optionnel] Quelle occurrence de la sous-chaîne à trouver dans la chaîne. Utiliser une occurrence négative pour rechercher à partir de la droite de la chaîne. La valeur par défaut est 1 (trouve la première occurrence).
start
	[optionnel] La position de départ de la recherche.
count
	[optionnel] Le nombre de caractères à rechercher. Ceci limite la recherche à une partie de la chaîne complète . Voir remarques.
@@End@@


###ReturnValue###
@@ReturnTable@@
Succès:	Retourne la position de la sous-chaîne.
Echec:	Retourne 0 si la sous-chaîne n'est pas trouvée.

@Error	0 - Opération normal
	1 - Paramètres 'start' ou 'occurrence' invalides.
@@End@@


###Remarks###
La position du premier caractère est 1.

Le paramètre 'count' doit être plus long que la sous-chaîne recherchée . Le paramètre 'count' (combiné avec le paramètre 'start') limite efficacement la recherche à une sous-chaîne de la chaîne complète.  Les déclarations suivantes sont équivalentes:
StringInStr("La chaîne à chercher", "chaîne", 0, 1, 1, 11)
StringInStr(StringMid("La chaîne à chercher", 1, 11), "chaîne")

###Related###
<a href="StringCompare.htm">StringCompare</a>, <a href="StringLeft.htm">StringLeft</a>, <a href="StringLen.htm">StringLen</a>, <a href="StringLower.htm">StringLower</a>, <a href="StringMid.htm">StringMid</a>, <a href="StringRight.htm">StringRight</a>, <a href="StringTrimLeft.htm">StringTrimLeft</a>, <a href="StringTrimRight.htm">StringTrimRight</a>, <a href="StringUpper.htm">StringUpper</a>, <a href="StringRegExp.htm">StringRegExp</a>, <a href="StringSplit.htm">StringSplit</a>


###Example###
@@IncludeExample@@


Traducteur : Alex74

Contributeurs (pour les modifications avant le Wiki) : Tlem