modernize code
This commit is contained in:
8
PCCcompiler/utils.cpp
Normal file
8
PCCcompiler/utils.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "utils.h"
|
||||
|
||||
std::string trim(const std::string& str) {
|
||||
size_t first = str.find_first_not_of(" \t");
|
||||
if (first == std::string::npos) return "";
|
||||
size_t last = str.find_last_not_of(" \t");
|
||||
return str.substr(first, last - first + 1);
|
||||
}
|
||||
Reference in New Issue
Block a user