#pragma once #include namespace XCEngine::UI::Editor::Support { inline std::string TruncateText(const std::string& text, std::size_t maxLength) { if (text.size() <= maxLength) { return text; } if (maxLength <= 3u) { return text.substr(0u, maxLength); } return text.substr(0u, maxLength - 3u) + "..."; } } // namespace XCEngine::UI::Editor::Support