System.SysUtils.StrLCopy
From RAD Studio API Documentation
Delphi
function StrLCopy(Dest: PAnsiChar; const Source: PAnsiChar; MaxLen: Cardinal): PAnsiChar; function StrLCopy(Dest: PWideChar; const Source: PWideChar; MaxLen: Cardinal): PWideChar;
C++
extern DELPHI_PACKAGE char * __fastcall StrLCopy _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (char * Dest, const char * Source, unsigned MaxLen)/* overload */;
Contents |
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Copies up to a specified maximum number of characters from Source to Dest.
StrLCopy copies a maximum MaxLen characters from Source to Dest, then adds a null terminator to Dest and returns Dest. The SizeOf standard function (Delphi) or the sizeof operator (C++) can be used to determine the MaxLen parameter. Usually, MaxLen equals SizeOf(Dest)-1.
Note: StrLCopy copies a null terminator as well as MaxLen characters. Be sure that Dest is large enough to accommodate the null terminator at the end.
See Also
Code Examples