Sign in Join
FPDoc Onlineexperiment

StuffString function

In unit StrUtils

Replace part of a string with another string.

Declaration

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

Arguments

AText

Text on which to operate.

AStart

Start of section to be replaced.

ALength

Length of section to be replaced.

ASubText

Text to insert at the indicated position.

Function result

Resulting string with indicated section replaced.

Description

StuffString returns a copy of AText with the segment starting at AStart with length ALength, replaced with the string ASubText. Basically it deletes the segment of Atext and inserts the new text in it's place.

Errors

No checking on the validity of the AStart and ALength parameters is done. Providing invalid values may result in access violation errors.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.