From Appmethod Libraries
Jump to: navigation, search

Object Pascal

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


extern DELPHI_PACKAGE int __fastcall ElementToCharLen(const System::AnsiString S, int MaxLen)/* overload */;


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


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