diff options
| author | Leonetienne <leonetienne@hotmail.de> | 2022-02-12 16:04:48 +0100 |
|---|---|---|
| committer | Leonetienne <leonetienne@hotmail.de> | 2022-02-12 16:04:48 +0100 |
| commit | 7726d64530f82fc9b8ac08f484491335bd7ca2a4 (patch) | |
| tree | 903e6f16b10f64a420c86ae93eaa8315a313ae2b /Src/StringTools.h | |
| parent | a8b8d557692823931bb41dcd55627080f55b6099 (diff) | |
Optimized directory structure
Diffstat (limited to 'Src/StringTools.h')
| -rw-r--r-- | Src/StringTools.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Src/StringTools.h b/Src/StringTools.h new file mode 100644 index 0000000..589c047 --- /dev/null +++ b/Src/StringTools.h @@ -0,0 +1,29 @@ +#pragma once
+#include <string>
+
+/* Handy utensils to manipulate strings */
+class StringTools
+{
+public:
+ //! Will replace every occurence of `find` in `str` by `subst`.
+ static std::string Replace(const std::string& str, const char find, const std::string& subst);
+
+ //! Will replace every occurence of `find` in `str` by `subst`.
+ static std::string Replace(const std::string& str, const std::string& find, const std::string& subst);
+
+ //! Will replace every occurence of `find` in `str` by `subst`.
+ static std::string Replace(const std::string& str, const char find, const char subst);
+
+ //! Will replace every occurence of `find` in `str` by `subst`.
+ static std::string Replace(const std::string& str, const std::string& find, const char subst);
+
+ //! Will make a string all-lowercase. Only works with latin and german umlautes, plus some extras.
+ static std::string Lower(const std::string& str);
+
+ //! Will make a string all-uppercase. Only works with latin and german umlautes, plus some extras.
+ static std::string Upper(const std::string& str);
+
+private:
+ // No instanciation! >:(
+ StringTools();
+};
|
