tables::column::starts_with,ends_with
1)
column<bool>
column<std::string_view>::starts_with(const std::string_view sv) const
2)
column<bool>
column<std::string_view>::starts_with(const column<std::string_view>& other) const
3)
column<bool>
column<std::string_view>::ends_with(const std::string_view sv) const
4)
column<bool>
column<std::string_view>::ends_with(const column<std::string_view>& other) const
-
Returns column-of-bools indicating if string starts with given prefix.
-
Returns column-of-bools indicating if string starts with given prefixes.
-
Returns column-of-bools indicating if string ends with given suffix.
-
Returns column-of-bools indicating if string ends with given suffixes.
Example
Code
#include <cpptables/table.hh>
using namespace tables;
using namespace std;
void column_starts_ends_with()
{
using sv_column = column<std::string_view>;
const sv_column xs({
"foo bar",
"foo abc def",
"hello world",
"foo abc def"
});
cout << xs.starts_with("foo") << "\n";
cout << xs.starts_with( sv_column({"foo","bar", "foo", "hello"}) ) << "\n";
cout << xs.ends_with("bar") << "\n";
cout << xs.ends_with( sv_column({"bar","bar", "world", "foo"}) ) << "\n";
}