System.AnsiStrings.CharToByteLen
Delphi
function CharToByteLen(const S: AnsiString; MaxLen: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall CharToByteLen _DEPRECATED_ATTRIBUTE1("Use CharToElementLen.") (const System::AnsiString S, int MaxLen)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.AnsiStrings.pas System.AnsiStrings.hpp |
System.AnsiStrings | System.AnsiStrings |
Description
Warning: CharToByteLen is deprecated. Please use CharToElementLen.
Returns the length, in bytes, of the first MaxLen characters of a string.
Call CharToByteLen to convert the length of a string in characters to the corresponding length in bytes. CharToByteLen returns the number of bytes required by the first MaxLen characters of S. If S contains fewer than MaxLen characters, CharToByteLen returns the byte length of S.
If the system is not using a multi-byte character system (MBCS), CharToByteLen returns the length of S or MaxLen, whichever is smaller.