String Object Implementation in C
The API is modelled on that of C++ std::string, as far as this is possible in C.
The API is intentionally rather minimal, and the underlying storage is compatible with string.h
.
std::string::assign
may be implemented asstring_clear
andstring_append_*
.std::string::copy
may be implemented asmemcpy
.std::string::find
may be implemented usingstrstr
andstrchr
.std::string::replace
may be implemented asstring_erase
andstring_insert_*
.