From RAD Studio API Documentation
Jump to: navigation, search


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


extern DELPHI_PACKAGE int __fastcall ElementToCharLen _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 ElementToCharLen is deprecated. Please use the AnsiStrings unit.

Returns the number of characters fully contained in the first MaxLen elements of a string.

Call ElementToCharLen to determine the number of characters represented by a portion of a string. ElementToCharLen counts characters until it reaches MaxLen elements or the end of the string, whichever comes first.

When working with multi-byte character systems (MBCS), the value returned by ElementToCharLen may be less than MaxLen or than the length of the string.

Note: ElementToCharLen counts a partial character if it appears as the last character of the first MaxLen elements.

See Also