From RAD Studio API Documentation
Jump to: navigation, search


function CharToElementLen(const S: AnsiString; MaxLen: Integer): Integer;
function CharToElementLen(const S: UnicodeString; MaxLen: Integer): Integer;


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


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


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

Returns the length, in bytes, of the first MaxLen characters of a string.

Call CharToElementLen to convert the length of a string in characters into the corresponding length in bytes. CharToElementLen returns the number of bytes required by the first MaxLen characters of S. If S contains fewer than MaxLen characters, CharToElementLen returns the byte length of S.

If the system is not using a multi-byte character system (MBCS), CharToElementLen returns the length of S or MaxLen, whichever is smaller.

See Also