Use FileName as Class Name Wren Script
This commit is contained in:
@@ -19,6 +19,18 @@ namespace Nuake {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool String::IsDigit(const char& character)
|
||||
{
|
||||
return character <= 57 && character >= 48;
|
||||
}
|
||||
|
||||
std::string String::RemoveWhiteSpace(const std::string& string)
|
||||
{
|
||||
std::string result = string;
|
||||
result.erase(remove_if(result.begin(), result.end(), isspace), result.end());
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> String::Split(const std::string& string, char delimiter)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
@@ -37,4 +49,22 @@ namespace Nuake {
|
||||
{
|
||||
return std::stof(string);
|
||||
}
|
||||
|
||||
std::string String::ToUpper(const std::string& string)
|
||||
{
|
||||
if(string.length() == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
auto split = Split(string, ' ');
|
||||
std::string result;
|
||||
for (auto& word : split)
|
||||
{
|
||||
word[0] = std::toupper(word[0]);
|
||||
result += word;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user