Asserts are good in the test cases, but not in the actual code. First, in a release version they are no-ops, so the release doesn't check anything. Second, they result in a program termination, which is a bit drastic.
Interfaces are unclear. What is
len
? It may only represent the length of the character array (vs C string), i.e. you do not rely on a terminating 0, and this, in turn, annuls the claim thatstrErase
is filling the end with null chars. If you do rely on a terminating 0, do not havelen
as a parameter, but calculate it.Treating negative count is a somewhat unorthodox. Normally (if allowed at all) it means "count backwards", that is, erase a [startIndex + count, startIndex) range.