Use FileName as Class Name Wren Script

This commit is contained in:
émeryc
2023-07-10 14:45:40 -04:00
parent 7599ed034b
commit cc03146cfc
5 changed files with 61 additions and 6 deletions

View File

@@ -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;
}
}