Summary: Hardcoded query infrastructure - first concrete version - USEFUL FOR: POCs & pilots Test Plan: manual + jenkins Reviewers: sale, florijan Reviewed By: florijan Subscribers: pullbot, buda Differential Revision: https://phabricator.memgraph.io/D45
26 lines
476 B
C++
26 lines
476 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace utils
|
|
{
|
|
|
|
/**
|
|
* Removes whitespace characters from the start and from the end of a string.
|
|
*
|
|
* @param str string that is going to be trimmed
|
|
*
|
|
* @return trimmed string
|
|
*/
|
|
std::string trim(const std::string &str)
|
|
{
|
|
size_t first = str.find_first_not_of(' ');
|
|
if (std::string::npos == first)
|
|
{
|
|
return str;
|
|
}
|
|
size_t last = str.find_last_not_of(' ');
|
|
return str.substr(first, (last - first + 1));
|
|
}
|
|
}
|