42_CPP00/ex01/utils.cpp

12 lines
168 B
C++
Raw Normal View History

2023-05-17 12:41:46 -04:00
#include <string>
std::string truncated(const std::string str)
{
std::string out;
out = str.substr(0, 10);
if (str.length() > 10)
out[9] = '.';
return (out);
}