ast updated
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string shorten(const std::string &string) {
|
||||
if (string.size() > 9) {
|
||||
std::string shortString;
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
shortString.push_back(string[i]);
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
shortString.push_back('.');
|
||||
}
|
||||
for (int i = string.size() - 6; i < string.size(); ++i) {
|
||||
shortString.push_back(string[i]);
|
||||
}
|
||||
return shortString;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
Reference in New Issue
Block a user