System.SysUtils.ElementToCharLen
Delphi
function ElementToCharLen(const S: AnsiString; MaxLen: Integer): Integer;
function ElementToCharLen(const S: UnicodeString; MaxLen: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall ElementToCharLen _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (const System::AnsiString S, int MaxLen)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
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.