StuffString

Replace part of a string with another string.

Declaration

Source position: strutils.pp line 74

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

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

Name Description
DelChars Delete all occurrences of a given character from a string.
DelSpace Delete all occurrences of a space from a string.
DupeString Creates and concatenates N copies of a string
ExtractSubStr Extract a word from a string, starting at a given position in the string.
FindPart Search for a substring in a string, using wildcards.