« StringPartIndex (rtl) » : différence entre les versions

De Wiki1000
Aucun résumé des modifications
 
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
<source lang='delphi'>Function StringPartIndex(const AString:string; const ASep:string; const APart:string):Integer;</source>
<source lang='delphi'>Function StringPartIndex(const AString:string; const ASep:string; const APart:string):Integer;</source>


description
Cette fonction retourne l'index d'une sous chaîne dans une chaîne constituée de sous chaîne séparées par des caractères sep.


{|class="wikitable"
{|class="wikitable"
|-
|-
|Result
|Result
|
|L'index de la sous chaîne.
|-
|-
|AString
|AString
|
|La chaîne constituée de sous chaînes.
|-
|-
|ASep
|ASep
|
|Le caractère séparateur de sous chaîne.
|-
|-
|APart
|APart
|
|La sous chaîne recherchée.
|-
|Result
|
|}
|}


Ligne 25 : Ligne 21 :


<source lang='delphi'>
<source lang='delphi'>
procedure foo(const s:string);
begin
begin
  // s = foo1,foo2,foo3,...
  if StringPartIndex(s,',','foo2')=1 then
  begin
  ...
  end;
end;
end;
</source>
</source>


Voir aussi:
Voir aussi:
*[[StringPart (rtl)|StringPart]]


{{Footer|Développement DSM}}
{{Footer|Développement DSM}}
[[category:RTL Chaîne]]
[[category:RTL Chaîne]]

Dernière version du 11 août 2009 à 13:40

<source lang='delphi'>Function StringPartIndex(const AString:string; const ASep:string; const APart:string):Integer;</source>

Cette fonction retourne l'index d'une sous chaîne dans une chaîne constituée de sous chaîne séparées par des caractères sep.

Result L'index de la sous chaîne.
AString La chaîne constituée de sous chaînes.
ASep Le caractère séparateur de sous chaîne.
APart La sous chaîne recherchée.

Exemple

<source lang='delphi'> procedure foo(const s:string); begin

 // s = foo1,foo2,foo3,...
 if StringPartIndex(s,',','foo2')=1 then
  begin
  ...
  end;

end; </source>

Voir aussi:

{{#if:Développement DSM|

{{#if:Développement DSM|— Développement DSM |}} — Développement DSM

|

{{#if:|— [[{{{1}}}]] |}} — Développement DSM

}}