Skip to content

Commit

Permalink
Add zen::string::isascii()
Browse files Browse the repository at this point in the history
  • Loading branch information
heinsaar committed Oct 17, 2023
1 parent f9e81b3 commit 9460323
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zen/datas/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ class string : public std::string, private zen::stackonly
return *this;
}

bool is_ascii()
{
for (char c : *this)
if (!isascii(c))
return false;
return true;
}

private:
using my = zen::string;
};
Expand Down

0 comments on commit 9460323

Please sign in to comment.