From RAD Studio API Documentation
Jump to: navigation, search


function ByteType(const S: AnsiString; Index: Integer): TMbcsByteType;
function ByteType(const S: UnicodeString; Index: Integer): TMbcsByteType;


extern DELPHI_PACKAGE TMbcsByteType __fastcall ByteType _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (const System::AnsiString S, int Index)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Warning: The ANSI version of ByteType is deprecated. Please use the AnsiStrings unit.

Indicates whether a byte in a string is a single-byte character, the first byte of a double-byte character, or the second byte of a double-byte character.

Call ByteType to determine whether a specified byte in a string is a single-byte character, the first byte of a multibyte character, or one of the trailing bytes.

AnsiString is the string that contains the byte in question.

Index identifies the byte whose type you want to know. Bytes are numbered from 1.

If the system is not using a multi-byte character system (MBCS), ByteType always returns mbSingleByte. Otherwise, ByteType returns mbSingleByte if the indicated byte represents a complete character in S, mbLeadByte if it represents the first byte of a double-byte character, and mbTrailByte if it represents a subsequent byte of a multibyte character.

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.

See Also