System.AnsiStrings.CharToByteIndex
Delphi
function CharToByteIndex(const S: AnsiString; Index: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall CharToByteIndex _DEPRECATED_ATTRIBUTE1("Use CharToElementIndex.") (const System::AnsiString S, int Index)/* overload */;
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
function | public | System.AnsiStrings.pas System.AnsiStrings.hpp |
System.AnsiStrings | System.AnsiStrings |
Description
Avertissement : CharToByteIndex est obsolète. Veuillez utiliser CharToElementIndex.
Renvoie l'indice en base 1 du premier octet d'un caractère spécifié dans une chaîne.
Appelez CharToByteIndex pour obtenir la position du caractère dans la chaîne S, où 1 spécifie le premier caractère, 2 le second, etc. CharToByteIndex renvoie zéro si Index est hors bornes (Index <= 0 ou S contient moins de Index caractères). Si le caractère indiqué par le paramètre Index est un caractère de deux octets, CharToByteIndex renvoie le décalage du premier octet.
Si le système n'utilise pas un jeu de caractères codés sur plusieurs octets (MBCS), CharToByteIndex renvoie la valeur de Index.