cpp/string/basic string/copy

Copies a substring to character string pointed to by. If the requested substring lasts past the end of the string, or if, the copied substring is. The resulting character string is not null-terminated.

Return value
Number of characters copied.

Exceptions
std if.

Complexity
Linear in.