---
name: "TTF_GetTextSubStringsForRange"
section: "3"
platform: "linux"
package: "libsdl3-ttf-doc"
version: "3.2.2+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/TTF_GetTextSubStringsForRange"
---

# TTF\_GetTextSubStringsForRange(3)

Get the substrings of a text object that contain a range of text.

## NAME

TTF\_GetTextSubStringsForRange - Get the substrings of a text object that contain a range of text.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

```
#include "SDL3_ttf/SDL_ttf.h"
```

**TTF\_SubString \*\* TTF\_GetTextSubStringsForRange(TTF\_Text \*text, int offset, int length, int \*count);**

## FUNCTION PARAMETERS

- *text*

  the  **TTF\_Text**\
    to query.

- *offset*

  a byte offset into the text string.

- *length*

  the length of the range being queried, in bytes, or -1 for the remainder of the string.

- *count*

  a pointer filled in with the number of substrings returned, may be NULL.

## RETURN VALUE

( **TTF\_SubString** *) Returns a NULL terminated array of* substring pointers or NULL on failure; call SDL\_GetError() for more information. This is a single allocation that should be freed with SDL\_free() when it is no longer needed.

## THREAD SAFETY

This function should be called on the thread that created the text.

## AVAILABILITY

This function is available since SDL\_ttf 3.0.0.
