Use std::string
and find
.
std::string str = "/user/desktop/abc/post/";
bool exists = str.find("/abc/") != std::string::npos;
More Related Contents:
- C++: While Looping Amount of Times
- C++ press enter to continue
- Array of pointers C++ creates of copy
- Error c4430 ? visual studio 2012 [closed]
- Possibilities to quit a function
- cout
- Order of evaluation of arguments using std::cout
- Visual Studio support for new C / C++ standards?
- _DEBUG vs NDEBUG
- How I can print the wchar_t values to console?
- Using Unicode in C++ source code
- How can I remove/refactor a «friend» dependency declaration properly?
- C++ string to enum
- stl::multimap – how do i get groups of data?
- Unit testing for C++ code – Tools and methodology [closed]
- How to parse date/time from string?
- How to use string.substr() function?
- What does “#pragma comment” mean?
- What is the preferred/idiomatic way to insert into a map?
- Custom Iterator in C++
- CUDA how to get grid, block, thread size and parallalize non square matrix calculation
- meaning of (number) & (-number)
- How does switch compile in Visual C++ and how optimized and fast is it?
- boost thread throwing exception “thread_resource_error: resource temporarily unavailable”
- Failing to map a simple unsigned byte rgb texture to a quad:
- How to check if a file is gzip compressed?
- How can I use a custom type as key for a map in C++?
- How do I convert from LPCTSTR to std::string?
- Initialization difference with or without curly braces in C++
- Why does int main() {} compile?