System.SysUtils.CharToElementLen

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

extern DELPHI_PACKAGE int __fastcall CharToElementLen _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 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