A lightweight, stb-style library for working with strings in C. It provides a string_t structure and abstracts many standard library string operations.
- Header-only (just include it and define the implementation macro)
- Safe creation from literals, sections, or formatted strings
- Append support (with optional
destroyto avoid leaks) - Automatic cleanup with
string_drop
Simply define CSTRING_IMPLEMENTATION and includen cstring.h into your project -
#define CSTRING_IMPLEMENTATION
#include "cstring.h"