12 lines
168 B
C++
12 lines
168 B
C++
|
#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);
|
||
|
}
|