# Mid()

Extracts a substring from a string.

```
Mid( string=string, start=number, count=number );
```

**Returns:** string

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| string | string | Yes | Must be single-quotation mark or double-quotation mark delimited. |  |
| start | number | Yes | The position of the first character to retrieve. |  |
| count | number | No | The number of characters to retrieve. If not set, all characters until the end of the string will be returned. | -1 |

# Examples

```cfml

str="I Love Lucee server";
writeOutput(mid(str,8,5));

//Member function
str="Hi buddy, Nice day!";
writeDump(str.mid(4,5));

```







# Categories

[Strings](../../categories/string.md)

# See Also

[string.mid()](../objects/string/mid.md)