SQL
Text Functions and Operators
<div class="nostroke_table"></div>  
|   |   |
|:--|:--------|
| **Description** |Extract a string using slice conventions similar to Python. Missing `begin` or `end` arguments are interpreted as the beginning or end of the list respectively. Negative values are accepted. |
| **Example** | `'DuckDB'[:4]` |
| **Result** | `Duck` |
| **Alias** | `array_slice` |  
More examples:  
```sql
SELECT
'abcdefghi' AS str,
str[3],    -- get char at position 3, 'c'
str[3:5],  -- substring from position 3 up to and including position 5, 'cde'
str[6:],   -- substring from position 6 till the end, 'fghi'
str[:3],   -- substring from the start up to and including position 3, 'abc'
str[3:-4], -- substring from positio 3 up to and including the 4th position from the end, 'cdef'
;
```