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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
class String
{
private:
/// String-Object should not be created
String();
public:
/// Splits the String into a Vector of Strings with a defined Length
/// If String.size() % Length is not 0 the last String has less Elements
static std::vector<std::string> Split(const std::string& rString, unsigned int Length, const std::string& rEnding = "");
/// Splits the String into a Vector of Strings
static std::vector<std::string> Explode(const std::string& rString, const std::string& rDelimiter, int SearchStart = 0);
/// Splits the String into a Vector of Strings, but doesn't erase delimiter
static std::vector<std::string> SoftExplode(const std::string& rString, const std::string& rDelimiter, int SearchStart = 0);
/// Takes the StringVector and Connects its Elements by "Delimiter"
static std::string Implode(const std::vector<std::string>& rvString, const std::string& rDelimiter = "");
/// Returns a String repeated RepeatCount times
static std::string Repeat(const std::string& rString, unsigned int RepeatCount);
/// Removes TrimChars from both sides of the String
/// Modifies the content of rString
static void Trim(std::string& rString, const std::string& rTrimChars = "\0\t\n\x0B\r ");
/// Returns the String in reversed Order
static std::string Reverse(const std::string& rString);
/// insert "Sequence" before each Pattern
/// Modifies the content of rString
static void InsertBeforePattern(std::string& rString, const std::string& rPattern, const std::string& rSequence);
/// Make sure "Sequence" appears before each Pattern
/// Modifies the content of rString
static void HaveBeforePattern(std::string& rString, const std::string& rPattern, const std::string& rSequence);
/// Replaces all occurences of 'Char' with 'Replaces'
/// Modifies the content of rString
static void ReplaceChar(std::string& rString, char Char, char Replace);
//// Replaces all occurences of 'Char' with 'Replaces'
/// Modifies the content of rString
static void ReplaceChars(std::string& rString, const std::string& rChars, const std::string& rReplaces);
/// if rReplaces.length() < rChars.length() the last characters will be replaced with " "
static void ReplaceChars(std::string& rString, const std::string& rChars, std::string& rReplaces);
/// Replaces all occurences of Pattern with Replace
/// Modifies the content of rString
static void ReplacePattern(std::string& rString, const std::string& rPattern, const std::string& rReplace);
/// Count the Appearences of Char
/// Case Sensetive
static unsigned int CountChar(const std::string& rString, char Char);
/// Count the Sum of appearences of the Chars
/// Case Sensetive
static unsigned int CountChars(const std::string& rString, const std::string& rChars);
/// Count the Appearences of Pattern
/// Case Sensetive
static unsigned int CountPattern(const std::string& rString, const std::string& rPattern);
/// Returns 1 of there are Only Letters in the String
static bool HasOnlyLetters(const std::string& rString);
/// Returns 1 of there are Only Numbers in the String
static bool HasOnlyNumbers(const std::string& rString);
/// Returns 1 of there is at least 1 Letter in the String
static bool HasLetters(const std::string& rString);
/// Returns 1 of there is at least 1 Number in the String
static bool HasNumbers(const std::string& rString);
}
|