All of the String types

April 7, 2026
Vibrant threads in various colors and textures in a tailor's atelier. Perfect for fashion and textile themes.
Photo by Ron Lach on Pexels

Strings: can’t live with them, can’t live without them. A new roundup aims to do what many devs quietly wish for — a single, no-nonsense list of the different string types you’ll encounter across languages. It has been reported that the author wrote the post after failing to find a comprehensive list elsewhere. The result reads like a tiny Tower of Babel for text: Rust’s trio, C’s classic pointers and arrays, C++’s generic basic_string, and the byte- and rune-centered view from Go all make an appearance.

What the roundup documents

Rust gets a lot of the spotlight: char as a Unicode code point (32-bit), Vec for per-character manipulation, String as the growable owned buffer (backed by a Vec), and str/&str/&mut str as the unsized slice types that force you to think about ownership and size. It has been reported that platform-facing types like OsString/OsStr behave differently by OS — allegedly WTF-8 on Windows and plain bytes on many Unixes — and that CString/CStr mirror C-style null-terminated byte sequences. C’s family — char, const char, char[N], wchar_t*, and the char16_t/char32_t/char8_t variants — gets a practical treatment: null-termination, ownership, mutability, and byte-width tradeoffs spelled out without hand-wringing.

Why it matters

Why care? Because encoding, ownership, and mutability aren’t academic nitpicks — they’re where bugs, security pitfalls, and baffling crashes hide. Interfacing across FFI boundaries, handling filenames on different OSes, and doing simple text manipulation all become design decisions when your “string” might be bytes, UTF-8, UTF-16, or a growable heap structure. The post does what good engineering docs should do: it maps the terrain so you stop guessing and start choosing.

Takeaway

If you’ve ever cursed at a mysterious segfault that turned out to be an encoding mismatch, this list will feel like a small victory. It’s not a deep tutorial, nor a definitive spec — but it is a handy compass. Read it, bookmark it, and next time someone asks “which string should I use?” you’ll have an answer that isn’t just hand-waving.

Sources: lambdalemon.gay, Lobsters