I
I
igoodmood2016-04-25 18:46:02
C++ / C#
igoodmood, 2016-04-25 18:46:02

Is there a function to count a specific character in a string in C++?

Hello, forum users! Maybe the question sounds stupid, but still: Is there a function to search for a specific element in a string? Or a function that counts a specific element in a string?
I know there are a lot of functions for working with strings. But searches on the Internet on this issue did not give the desired results. Thanks everyone for the response.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AtomKrieg, 2016-04-25
@AtomKrieg

www.cplusplus.com/reference/algorithm/count
study the standard library

M
MiiNiPaa, 2016-04-25
@MiiNiPaa

You didn’t find it, because no one needs a function to count the number of certain characters in a string, when there is a function to count the number of arbitrary elements in an arbitrary sequence: en.cppreference.com/w/cpp/algorithm/count

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question