RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
StrUtils.LeftStr Function

Returns the substring of a specified length that appears at the start of a string.

Pascal
function LeftStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
function LeftStr(const AText: WideString; const ACount: Integer): WideString; overload;
C++
AnsiString LeftStr(const AnsiString AText, const int ACount);
BSTR LeftStr(const BSTR AText, const int ACount);

LeftStr returns the leading characters of AText up to a length of ACount characters.

Note: If AText is an AnsiString and the current locale uses multi-byte characters, LeftStr may return more than ACount bytes. To return a specific number of bytes, use LeftBStr.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!