Help with \0 terminated strings in C#

.NET strings are not null-terminated (as you may have guessed from this). So, you can treat the ‘\0’ as you would treat any normal character. Normal string manipulation will fix things for you. Here are some (but not all) options. s = s.Trim(‘\0’); s = s.Replace(“\0”, “”); var strings = s.Split(new char[] {‘\0’}, StringSplitOptions.RemoveEmptyEntries); If … Read more

How is std::string implemented?

Virtually every compiler I’ve used provides source code for the runtime – so whether you’re using GCC or MSVC or whatever, you have the capability to look at the implementation. However, a large part or all of std::string will be implemented as template code, which can make for very difficult reading. Scott Meyer’s book, Effective … Read more