Description |
The StuffString function inserts a SubString into another string, replacing Length characters at position Start.
If the length is -1, then teh string is simply inserted, and does not replace any characters.
|
|
Notes |
Strings are indexed from 1 (arrays from 0).
|
|
Related commands |
AnsiReplaceStr |
|
Replaces a part of one string with another |
Copy |
|
Create a copy of part of a string or an array |
Insert |
|
Insert a string into another string |
Move |
|
Copy bytes of data from a source to a destination |
StringReplace |
|
Replace one or more substrings found within a string |
|
|
|
Example code : A simple example |
var
source, target : AnsiString;
begin
source := '123456789';
target := StuffString(source, 2, 4, '-inserted-');
WriteLn('Source = '+source);
WriteLn('Target = '+target);
end;
|
Show full unit code |
Source = 123456789
Target = 1-inserted-6789
|
|