System.SysUtils.ByteToCharLen
Delphi
function ByteToCharLen(const S: UnicodeString; MaxLen: Integer): Integer;
function ByteToCharLen(const S: AnsiString; MaxLen: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall ByteToCharLen _DEPRECATED_ATTRIBUTE1("Use ElementToCharLen.") (const System::UnicodeString S, int MaxLen)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Warning: ByteToCharLen is deprecated. Please use ElementToCharLen.
Returns the number of characters fully contained in the first MaxLen bytes of a string.
Call ByteToCharLen to determine the number of characters represented by a portion of a string. ByteToCharLen counts characters until it reaches MaxLen bytes or the end of the string, whichever comes first.
When working with multi-byte character systems (MBCS), the value returned by ByteToCharLen may be less than MaxLen or the length of the string.
Note: ByteToCharLen will count a partial character if it appears as the last of the first MaxLen bytes.