Use the substr() function to efficiently output all the strings used in a string

Required header files

#include<string>

Other things needed

using namespace std;

substr(pos,len) returns a substring of length len starting from the pos number position, and the time complexity is O(len)

It is very convenient to use it to output all the strings of a string.

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_46527915/article/details/115330849