BAN: add StringView::contains(char)

This commit is contained in:
Bananymous 2023-06-05 22:46:37 +03:00
parent c6b5cc1e07
commit 290b81dedc
2 changed files with 9 additions and 0 deletions

View File

@ -145,6 +145,14 @@ namespace BAN
return m_data[0];
}
bool StringView::contains(char ch) const
{
for (size_type i = 0; i < m_size; i++)
if (m_data[i] == ch)
return true;
return false;
}
StringView::size_type StringView::count(char ch) const
{
size_type result = 0;

View File

@ -35,6 +35,7 @@ namespace BAN
char back() const;
char front() const;
bool contains(char) const;
size_type count(char) const;
bool empty() const;