---
url: >-
  /statelake/scripting-reference/functions-and-procedures/string-functions/delete.md
---

# Delete

The **Delete** function deletes the number of characters specified by **iCount**, starting at the position given by **iFrom**.

The first character in a string is position 1.

To delete just a single character, set **iCount** to 1.

If **iFrom** is larger than the length of the string or less than 1, no characters are deleted.

If **iCount** is equal to or less than zero (0), then no characters are deleted.

If **iCount** specifies more characters than are remaining in the string, Delete deletes all those remaining characters.

**Declaration**: procedure Delete(var s: string; iFrom, iCount: Integer);

A simple example.

```pascal
procedure OnMapEvent(var Value:Variant);
var
  mystring : string;
begin
  mystring := 'abcdef';
  Delete(mystring,2,3);        // mystring becomes 'aef'
end;
```
