summaryrefslogtreecommitdiffstats
path: root/Src/StringTools/StringTools.h
blob: 589c0474445ac4866fa2266428ecbc7886d3afe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
};