If I have a C string, which is a pointer to an array of characters with a null terminating character, how can I convert it to a regular D string?
The reason I would like to know this is because I am currently using an external C library, which returns C strings on error.
Use function std.conv.to:
std.conv.to
char* c_str = c_function(); string s = to!string(c_str);
You can also slice and / or duplicate the string c:
char[] arr = c_str[0 .. strlen(c_str)]; string s = arr.idup;
etc.