RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.CharToByteLen Function

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

Pascal
function CharToByteLen(const S: string; MaxLen: Integer): Integer;
C++
int CharToByteLen(const AnsiString S, int MaxLen);

SysUtils

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

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

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!