StringTools/Src/StringTools.h

34 lines
1.1 KiB
C
Raw Normal View History

2022-02-12 18:19:17 +01:00
#ifndef STRINGTOOLS_STRINGTOOLS_H
#define STRINGTOOLS_STRINGTOOLS_H
2021-11-20 19:24:35 +01:00
#include <string>
/* Handy utensils to manipulate strings */
2021-11-20 18:37:20 +01:00
class StringTools
{
2021-11-20 19:24:35 +01:00
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);
2021-11-20 18:37:20 +01:00
2021-11-20 19:24:35 +01:00
//! 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);
2022-02-12 18:19:17 +01:00
//! Will make a string all-lowercase.
2021-12-04 20:18:09 +01:00
static std::string Lower(const std::string& str);
2022-02-12 18:19:17 +01:00
//! Will make a string all-uppercase.
2021-12-04 20:29:17 +01:00
static std::string Upper(const std::string& str);
2021-11-20 19:24:35 +01:00
private:
// No instanciation! >:(
StringTools();
};
2022-02-12 18:19:17 +01:00
#endif //STRINGTOOLS_STRINGTOOLS_H