RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
StrUtils.StuffString Function

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

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

StrUtils

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. 

 

AnsiReplaceStr 

AnsiReplaceText 

StringReplace

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