---
url: /flow/guide/scripting-reference/functions/string/copy.md
---

# Copy

## Declaration

`function Copy(S: string; Index: Integer; Count: Integer): string;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value :=copy('this is some text',6,2); //returns 'is'
end;
```

## Description

Returns a sub-string of Count characters starting at position given by Index. Index should be set to 1 for the first character. Count is the number of characters to return including the starting character.
