BAN: add StringView::contains(char)
This commit is contained in:
parent
c6b5cc1e07
commit
290b81dedc
|
@ -145,6 +145,14 @@ namespace BAN
|
||||||
return m_data[0];
|
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
|
StringView::size_type StringView::count(char ch) const
|
||||||
{
|
{
|
||||||
size_type result = 0;
|
size_type result = 0;
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace BAN
|
||||||
char back() const;
|
char back() const;
|
||||||
char front() const;
|
char front() const;
|
||||||
|
|
||||||
|
bool contains(char) const;
|
||||||
size_type count(char) const;
|
size_type count(char) const;
|
||||||
|
|
||||||
bool empty() const;
|
bool empty() const;
|
||||||
|
|
Loading…
Reference in New Issue