RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
AnsiStringBase::ByteType Method

Indicates the kind of byte that occupies a specified position in the System::AnsiStringBase.

Pascal
function ByteType(index: Integer): TStringMbcsByteType;
C++
__fastcall TStringMbcsByteType ByteType(int index) const;

System::AnsiStringBase::ByteType indicates what kind of byte exists at the byte indicated by index (counting from 1) in the System::AnsiStringBase. These are the possible return values.

Constant 
Meaning 
mbSingleByte  
Single byte character.  
mbLeadByte  
Lead byte of a multi-byte character.  
mbTrailByte  
Trailing byte of a multi-byte character.  

Some locales, including all Western locales, do not use multi-byte characters. Under those locales, System::AnsiStringBase::ByteType always returns mbSingleByte.

Note: No checking is done to ensure that Index is less than the length of S. It is the caller's responsibility to ensure that Index is not out of bounds.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!