diff options
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 4a5f21ddc2..849e83815c 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -259,6 +259,13 @@ void ReplaceBreaksWithSpaces(std::string& str) std::replace(str.begin(), str.end(), '\n', ' '); } +void TruncateToCString(std::string* s) +{ + const size_t terminator = s->find_first_of('\0'); + if (terminator != s->npos) + s->resize(terminator); +} + bool TryParse(const std::string& str, bool* const output) { float value; |
