---
name: "al_ustr_assign_substr"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_ustr_assign_substr"
---

# al\_ustr\_assign\_substr(3)

Allegro 5 API

## NAME

al\_ustr\_assign\_substr - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  bool al_ustr_assign_substr(ALLEGRO_USTR *us1, const ALLEGRO_USTR *us2,
     int start_pos, int end_pos)
  ```

## DESCRIPTION

Overwrite the string `us1` with the contents of `us2` in the byte interval \[`start_pos`, `end_pos`). The end points will be clamped to the bounds of `us2`.

Usually you will first have to use [al\_ustr\_offset(3)](/al_ustr_offset/3.md) to find the byte offsets.

Returns true on success, false on error.

## SEE ALSO

[al\_ustr\_assign(3)](/al_ustr_assign/3.md), [al\_ustr\_assign\_cstr(3)](/al_ustr_assign_cstr/3.md)
