Doubt with usage of string::substr() function

If the length of the string is less than the length of the substring requested, what will happen to the substring?
You'll get up to the end of the string.
See this page: http://www.cplusplus.com/reference/string/string/substr/

if the string is shorter, as many characters as possible are used
Topic archived. No new replies allowed.