void main() {
string test = "abc\0def";
printf("\ntest='%s'", test); // Prints 'abc' -- as expected
string mid = strmid(test, 0, 2);
printf("\nmid='%s'", mid); // Prints 'ab' -- as expected
string mid = strmid(test, 2, 2);
printf("\nmid='%s'", mid); // Prints 'c' -- as expected
string mid = strmid(test, 3, 2);
printf("\nmid='%s'", mid); // Prints 'c' -- that appears wrong. Should yield an empty string
string mid = strmid(test, 4, 2);
printf("\nmid='%s'", mid); // Prints 'c' -- that definitely appears wrong. Should print an empty string or 'de'
}