Tag: string
4 posts
-
C++ Regular Expression Basics: std::regex Matching, Capture Groups and Tokenizing
A beginner-focused introduction to std::regex: the regex_match vs regex_search mistake almost everyone makes first, how capture groups are indexed, and the raw-string habit that avoids double-escaping bugs.
-
Rust String vs &str: Heap Strings, Slices, Ownership and Function Signatures
Compare Rust String and str: heap vs slice, borrowing vs ownership, function signatures, conversions, and common lifetime mistakes.
-
std::string Pitfalls: SSO, c_str() Lifetime, string_view Dangling and UTF-8
Practical std::string guide: concatenation, compare, substr, find, replace, SSO, string_view lifetime, reserve for +=, and c_str validity in modern C++.
-
C++ string vs string_view: Fast, Non-Owning String Handling
std::string vs std::string_view: avoid copies in read-only APIs, allocation costs, lifetime rules, substring performance, and null-termination caveats.