tlx
Loading...
Searching...
No Matches
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 <tb@panthema.net>
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
/******************************************************************************/
contains.hpp
tlx::contains
bool contains(const std::string &str, const std::string &pattern)
Tests of string contains pattern.
Definition
contains.cpp:15
tlx
Definition
exclusive_scan.hpp:17
tlx
string
contains.cpp
Generated on Sun Jan 19 2025 00:00:00 for tlx by
1.12.0