StringTools/Src/StringTools.h

30 lines
1.1 KiB
C
Raw Normal View History

2021-11-20 18:37:20 +01:00
#pragma once
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);
2021-12-04 20:18:09 +01:00
//! Will make a string all-lowercase. Only works with latin and german umlautes, plus some extras.
static std::string Lower(const std::string& str);
2021-12-04 20:29:17 +01:00
//! Will make a string all-uppercase. Only works with latin and german umlautes, plus some extras.
static std::string Upper(const std::string& str);
2021-11-20 19:24:35 +01:00
private:
// No instanciation! >:(
StringTools();
};