Add source code.

This commit is contained in:
alejo committed 2026-10-17 03:29:11 -03:00
1 parent dab19ace02
commit 0b8a7b3cdc
31 files changed
+2809

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <cstddef>
#include <string>
#include <vector>
namespace StringUtil {
std::string lower(const std::string& text);
std::string trim(const std::string& text);
bool equalsIgnoreCase(const std::string& a, const std::string& b);
bool startsWithIgnoreCase(const std::string& text, const std::string& prefix);
std::string join(const std::vector<std::string>& parts, std::size_t from, const std::string& separator);
// Number of characters (UTF-8 code points) in the text.
std::size_t displayWidth(const std::string& text);
// Collapses line breaks into " / ". If `maxChars` > 0 the text is cut to that
// many characters; 0 means no limit.
std::string singleLine(const std::string& text, std::size_t maxChars);
} // namespace StringUtil