std::wcsstr
cppreference.com
<tbody>
</tbody>
const wchar_t* wcsstr( const wchar_t* dest, const wchar_t* src ); |
||
wchar_t* wcsstr( wchar_t* dest, const wchar_t* src ); |
||
src , dest. .
| dest | ||
| src |
dest , . src , dest.
#include <clocale>
#include <cwchar>
#include <iostream>
int main()
{
wchar_t const* origin = L", , , , , .";
wchar_t const* target = L"";
wchar_t const* result = origin;
std::setlocale(LC_ALL, "en_US.utf8");
std::wcout.imbue(std::locale("en_US.utf8"));
std::wcout << L" : \"" << target << L"\"\n"
<< L" : \"" << origin << L"\"\n\n";
for (; (result = std::wcsstr(result, target)) != nullptr; ++result)
std::wcout << L": \"" << result << L"\"\n";
}
:
Substring to find: ""
String to search: ", , , , , ."
Found: ", , , , ."
Found: ", ."
| (public - std::basic_string<CharT,Traits,Allocator>)
| |
| () | |
| () | |
| () | |
C wcsstr
| |