StringTools/Src/StringTools.h

38 lines
1.3 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>
2022-03-13 15:52:53 +01:00
#include <vector>
2021-11-20 19:24:35 +01:00
/* Handy utensils to manipulate strings */
2021-11-20 18:37:20 +01:00
class StringTools
{
2021-11-20 19:24:35 +01:00
public:
2022-03-13 15:52:53 +01:00
//! 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);
2021-11-20 19:24:35 +01:00
2022-03-13 15:52:53 +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 std::string& subst);
2021-11-20 18:37:20 +01:00
2022-03-13 15:52:53 +01:00
//! 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 19:24:35 +01:00
2022-03-13 15:52:53 +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);
2021-12-04 20:18:09 +01:00
2022-03-13 15:52:53 +01:00
//! Will make a string all-lowercase.
static std::string Lower(const std::string& str);
//! Will make a string all-uppercase.
static std::string Upper(const std::string& str);
//! Will split a string by a string seperator
static std::vector<std::string> Split(const std::string& str, const std::string& seperator);
2021-12-04 20:29:17 +01:00
2021-11-20 19:24:35 +01:00
private:
2022-03-13 15:52:53 +01:00
// No instanciation! >:(
StringTools();
2021-11-20 19:24:35 +01:00
};
2022-02-12 18:19:17 +01:00
#endif //STRINGTOOLS_STRINGTOOLS_H