RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
StrUtils.MidBStr Function

Returns the substring of a specified number of bytes that appears at a specified position in a string.

Pascal
function MidBStr(const AText: AnsiString; const AByteStart: Integer; const AByteCount: Integer): AnsiString;
C++
AnsiString MidBStr(const AnsiString AText, const int AByteStart, const int AByteCount);

StrUtils

MidBStr returns a substring AByteCount bytes beginning at AByteStart bytes.  

If AByteStart is larger than the length of AText in bytes, MidBStr returns an empty string. 

If AByteCount specifies more bytes than are available, only the available bytes are returned.

Note: MidBStr assumes all characters are one byte long, and does not behave correctly if AText contains multi-byte characters. To handle all strings correctly, use MidStr.
 

 

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