Namespaces
Variants
Actions

std::char_traits<char>::find, std::char_traits<wchar_t>::find, std::char_traits<char8_t>::find, std::char_traits<char16_t>::find, std::char_traits<char32_t>::find

From cppreference.com
< cpp‎ | string‎ | char traits
 
C++
 
Strings library
 
std::char_traits
static const char_type*
    find( const char_type* ptr, std::size_t count, const char_type& ch );
(constexpr since C++17)

Searches for character ch within the first count characters of the sequence pointed to by ptr.

See CharTraits for the general requirements on character traits for X::find.

[edit] Parameters

ptr - pointer to a character string to search
count - the number of characters to analyze
ch - the character to search for

[edit] Return value

A pointer to the first character in the range specified by [ptrptr + count) that compares equal to ch, or a null pointer if not found.

[edit] Complexity

Linear in count.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant