S SideAngleSide Ars Scholae Palatinae 26y 1,472 Subscriptor Mar 5, 2002 #1 Mar 5, 2002 Add bookmark #1 Is there a way in C++ to check for the existence of a string within a string such as 'dog' within "my dog barks a lot" ••• More options Report Add bookmark Share
Is there a way in C++ to check for the existence of a string within a string such as 'dog' within "my dog barks a lot"
D DrPizza Well-known member 27y 93,870 Mar 5, 2002 #2 Mar 5, 2002 Add bookmark #2 <tt>std::string::find()</tt> and related functions. ••• More options Report Add bookmark Share
P phridge Ars Praetorian 27y 519 Mar 5, 2002 #3 Mar 5, 2002 Add bookmark #3 More generally, you can use std::search to find subsequences in any forward container. But, string::find will be faster for searching strings. ••• More options Report Add bookmark Share
More generally, you can use std::search to find subsequences in any forward container. But, string::find will be faster for searching strings.
pholus Ars Praefectus 25y 3,170 Mar 5, 2002 #4 Mar 5, 2002 Add bookmark #4 What is meant by "forward container"? Thanks. ••• More options Report Add bookmark Share
P phridge Ars Praetorian 27y 519 Mar 5, 2002 #5 Mar 5, 2002 Add bookmark #5 A forward container is any data structure that can be traversed from beginning to end. ••• More options Report Add bookmark Share