We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The method substr() of the class string works as in his prototype:
std::string::substr(size_tpos,size_tlen)const;
where, the first argument that it takes is the position of the fisrt character of the string, but not the character itself. Whereas the second argument indicates the number of characters to include in the subtring.
Strings
You are viewing a single comment's thread. Return to all comments →
The method substr() of the class string works as in his prototype:
where, the first argument that it takes is the position of the fisrt character of the string, but not the character itself. Whereas the second argument indicates the number of characters to include in the subtring.
Reference: www.cplusplus.com/reference/string/string/substr/