Is there any pre-defined function to achieve this task?
No. Since that's the only actual question in your question, I'm tempted to stop there.
We can write many different functions to do this - which ones are a good choice depend on things like how long your strings are, how much time you can justify spending on this, how important its performance is to your program, etc. etc.
The closest to a pre-defined function we can get is a (long) oneliner, like
bool contained = std::ranges::includes(std::set<char>{str.begin(), str.end()},
std::set<char>{prt.begin(), prt.end()});
It requires C++20 ranges, and creates a couple of temporary sets, each containing every unique letter in one of the strings.
If you don't have C++20 support or don't need it to fit on one line, you can easily materialize those temporary sets as in Remy's answer, and call the older std::includes
(although that's still preferable to using set_intersection
here).
There's an un-answered question in comments about repeated characters: this doesn't check whether str
contains at least as many of each distinct character as prt
does.