Doubt with usage of string::substr() function

Jun 15, 2013 at 5:22am
If the length of the string is less than the length of the substring requested, what will happen to the substring?
Jun 15, 2013 at 5:59am
You'll get up to the end of the string.
Jun 15, 2013 at 6:02am
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.