RAD Studio VCL Reference
StrUtils.StuffString Function

Inserts a substring into a specified position of a string, replacing the current characters.

function StuffString(const AText: string; AStart: Cardinal; ALength: Cardinal; const ASubText: string): string; overload;
AnsiString StuffString(const AnsiString AText, unsigned AStart, unsigned ALength, const AnsiString ASubText);

StuffString returns a new string that is constructed by replacing the characters of AText specified by AStart and ALength with the string specified by ASubText. 

AText is the string to which ASubText is added. It is not modified by StuffString. 

AStart is the index of the first character in AText to be replaced, where 1 identifies the first character, 2 identifies the second character, and so on. 

ALength is the number of characters in AText that are replaced by ASubText. If ALength is 0, ASubText is inserted into AText without removing any characters. If AText is negative, the characters preceding the insertion point are duplicated after the occurrence of ASubText in the result string. 

ASubText is the substring to insert into AText, replacing the characters specified by AStart and ALength. 


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