System.StrUtils.StuffString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

extern DELPHI_PACKAGE System::UnicodeString __fastcall StuffString(const System::UnicodeString AText, unsigned AStart, unsigned ALength, const System::UnicodeString ASubText)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.StrUtils.pas
System.StrUtils.hpp
System.StrUtils System.StrUtils

Description

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

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.

See Also