Delete elements (characters) from a string or dynamic array.
Source position: system.fpd line 40
procedure Delete( |
var S: string; |
const Index: Integer; |
const Count: Integer |
); |
var A: DynArrayType; |
const Index: Integer; |
const Count: Integer |
); |
Delete removes Count characters from string S, starting at position Index. Index is 1-based. All characters after the deleted characters are shifted Count positions to the left, and the length of the string is adjusted.
For dynamic arrays, Delete removes Count elements from the array A, starting at position Index. Index is 0-based. All elements after the deleted elements are shifted Count positions to the left, and the length of the array is adjusted.
If the sum of Index and Count exceeds the length of the string or array, Delete removes the end of the string or array, starting at Index.
If Index is less than 1 or greater than the length of the string or array, or if Count is negative or zero, Delete does nothing.
|
Copy part of a string or dynamic array. |
|
|
Search for substring in a string. |
|
|
Insert one string or dynamic array in another. |
Program Example15; { Program to demonstrate the Delete function. } Var S : String; begin S:='This is not easy !'; Delete (S,9,4); { S:='This is easy !' } end.