std::basic_string_view<CharT,Traits>::ends_with
提供: cppreference.com
< cpp | string | basic string view
constexpr bool ends_with( basic_string_view sv ) const noexcept; |
(1) | (C++20以上) |
constexpr bool ends_with( CharT c ) const noexcept; |
(2) | (C++20以上) |
constexpr bool ends_with( const CharT* s ) const; |
(3) | (C++20以上) |
文字列ビューが指定された接尾辞で終わるかどうか調べます。
1) 接尾辞は文字列ビューです。 実質的に size() >= sv.size() && compare(size() - sv.size(), npos, sv) == 0 を返します。
2) 接尾辞は単一の文字です。 実質的に !empty() && Traits::eq(back(), c) を返します。
3) 接尾辞はヌル終端文字列です。 実質的に ends_with(basic_string_view(s)) を返します。
目次 |
[編集] 引数
sv | - | 文字列ビュー。 std::basic_string から暗黙に変換した結果でも構いません。
|
c | - | 単一の文字。 |
s | - | ヌル終端文字列。 |
[編集] 戻り値
文字列ビューが指定された接尾辞で終わるならば true、そうでなければ false。
[編集] 例
This section is incomplete Reason: no example |
[編集] 関連項目
(C++20) |
文字列ビューが指定された接頭辞で始まるか調べます (パブリックメンバ関数) |
(C++20) |
文字列が指定された接頭辞で始まるか調べます ( std::basic_string<CharT,Traits,Allocator> のパブリックメンバ関数)
|
(C++20) |
文字列が指定された接尾辞で終わるか調べます ( std::basic_string<CharT,Traits,Allocator> のパブリックメンバ関数)
|
2つのビューを比較します (パブリックメンバ関数) |