System.AnsiStrings.SearchBuf

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function SearchBuf(Buf: PAnsiChar; BufLen: Integer; SelStart, SelLength: Integer;
SearchString: AnsiString; Options: TStringSearchOptions): PAnsiChar;

C++

extern DELPHI_PACKAGE char * __fastcall SearchBuf(char * Buf, int BufLen, int SelStart, int SelLength, System::AnsiString SearchString, System::Strutils::TStringSearchOptions Options = (System::Strutils::TStringSearchOptions() << System::Strutils::TStringSeachOption::soDown ))/* overload */;

Propriétés

Type Visibilité  Source Unité  Parent
function public
System.AnsiStrings.pas
System.AnsiStrings.hpp
System.AnsiStrings System.AnsiStrings

Description

Recherche une sous-chaîne dans un tampon de texte.

Appelez SearchBuf pour rechercher une chaîne spécifiée dans un tampon de texte.

Buf représente le tampon de texte dans lequel effectuer la recherche.

BufLen désigne la longueur, en octets, de Buf.

SelStart est le premier caractère de la recherche lorsque Options indique une recherche en arrière (valeur frDown non incluse). Le premier caractère de Buf a la position 0.

SelLength représente le nombre de caractères après SelStart à partir duquel la recherche commence lorsque Options indique une recherche vers l'avant (valeur soDown incluse).

SearchString désigne la chaîne à rechercher dans Buf.

Options détermine si la recherche s'exécute vers l'avant (soDown) ou vers l'arrière à partir de SelStart ou SelStart+SelLength, si elle tient compte de la casse (soMatchCase) et si la chaîne correspondante doit être un mot entier (soWholeWord).

Si SearchBuf trouve une correspondance, elle renvoie un pointeur sur le premier caractère de la chaîne correspondante dans Buf. Si elle ne trouve pas de correspondance, SearchBuf renvoie nil (Delphi) ou NULL (C++).

Voir aussi