Thrill  0.1
contains.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * tlx/string/contains.cpp
3  *
4  * Part of tlx - http://panthema.net/tlx
5  *
6  * Copyright (C) 2007-2017 Timo Bingmann <[email protected]>
7  *
8  * All rights reserved. Published under the Boost Software License, Version 1.0
9  ******************************************************************************/
10 
11 #include <tlx/string/contains.hpp>
12 
13 namespace tlx {
14 
15 bool contains(const std::string& str, const std::string& pattern) {
16  return str.find(pattern) != std::string::npos;
17 }
18 
19 bool contains(const std::string& str, const char* pattern) {
20  return str.find(pattern) != std::string::npos;
21 }
22 
23 bool contains(const std::string& str, const char ch) {
24  return str.find(ch) != std::string::npos;
25 }
26 
27 } // namespace tlx
28 
29 /******************************************************************************/
bool contains(const std::string &str, const std::string &pattern)
Tests of string contains pattern.
Definition: contains.cpp:15
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Definition: allocator.hpp:220