| bubu ( |
size_t count_ending_endlines(const std::string& str)
{
for (std::string::const_reverse_iterator it = str.rbegin(); it != str.rend(); ++it)
{
if (*it != '\n')
{
return std::distance(str.rbegin(), it);
}
}
return str.empty() ? 0 : str.size();
}Nopūsties: