forked from Bananymous/banan-os
BAN: add StringView::contains(char)
This commit is contained in:
parent
0b1b4d8f7e
commit
6aff459e1c
|
@ -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;
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace BAN
|
|||
char back() const;
|
||||
char front() const;
|
||||
|
||||
bool contains(char) const;
|
||||
size_type count(char) const;
|
||||
|
||||
bool empty() const;
|
||||
|
|
Loading…
Reference in New Issue