Show: Object Pascal C++
Display Preferences


From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function StrByteType(Str: PAnsiChar; Index: Cardinal): TMbcsByteType;
function StrByteType(Str: PWideChar; Index: Cardinal): TMbcsByteType;


extern DELPHI_PACKAGE TMbcsByteType __fastcall StrByteType _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (char * Str, unsigned Index)/* overload */;


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


Warning: Ansi version of StrByteType is deprecated. Please use 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 StrByteType to determine the type of the byte specified by the Index parameter, where 0 specifies the first byte in the string Str, 1 specifies the second byte, and so on.

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

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

See Also

Personal tools