Skip to content

Commit

Permalink
Minor change to use cpp 20 method
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcidev committed Aug 24, 2024
1 parent e6d61a5 commit f9b8e22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Server/Server/StaticHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ std::string StaticHelper::ToUpper(std::string_view str)

void StaticHelper::Trim(std::string& str)
{
auto it1 = std::find_if(str.begin(), str.end(), [](char ch) { return !std::isspace(ch); });
auto it1 = std::ranges::find_if(str, [](char ch) { return !std::isspace(ch); });
str.erase(str.begin(), it1);

auto it2 = std::find_if(str.rbegin(), str.rend(), [](char ch) { return !std::isspace(ch); });
auto it2 = std::ranges::find_if(str.rbegin(), str.rend(), [](char ch) { return !std::isspace(ch); });
str.erase(it2.base(), str.end());
}

0 comments on commit f9b8e22

Please sign in to comment.