Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
5d5c2773
Commit
5d5c2773
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Add overload of simox::alg::contains taking char and char[]
parent
d67cb91d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SimoxUtility/algorithm/string/string_tools.h
+12
-0
12 additions, 0 deletions
SimoxUtility/algorithm/string/string_tools.h
with
12 additions
and
0 deletions
SimoxUtility/algorithm/string/string_tools.h
+
12
−
0
View file @
5d5c2773
...
...
@@ -44,6 +44,7 @@ namespace simox::alg
*/
std
::
string
capitalize_words
(
const
std
::
string
&
str
);
void
trim
(
std
::
string
&
str
,
const
std
::
locale
&
locale
=
DEFAULT_LOCALE
);
std
::
string
trim_copy
(
const
std
::
string
&
str
,
const
std
::
locale
&
locale
=
DEFAULT_LOCALE
);
...
...
@@ -52,6 +53,7 @@ namespace simox::alg
std
::
string
trim_copy_if
(
const
std
::
string
&
str
,
const
std
::
string
&
trim
=
"
\t
"
);
std
::
vector
<
std
::
string
>
split
(
const
std
::
string
&
str
,
const
std
::
string
&
splitBy
=
"
\t
"
,
bool
trimElements
=
true
,
bool
removeEmptyElements
=
true
,
const
std
::
locale
&
locale
=
DEFAULT_LOCALE
);
...
...
@@ -62,17 +64,27 @@ namespace simox::alg
std
::
string
join
(
const
std
::
vector
<
std
::
string
>
vec
,
const
std
::
string
&
delimiter
=
" "
,
bool
trimElements
=
false
,
bool
ignoreEmptyElements
=
false
,
const
std
::
locale
&
locale
=
DEFAULT_LOCALE
);
std
::
string
replace_first
(
std
::
string
const
&
input
,
std
::
string
const
&
search
,
std
::
string
const
&
replace
);
std
::
string
replace_last
(
std
::
string
const
&
input
,
std
::
string
const
&
search
,
std
::
string
const
&
replace
);
std
::
string
replace_all
(
std
::
string
const
&
input
,
std
::
string
const
&
search
,
std
::
string
const
&
replace
);
bool
starts_with
(
std
::
string
const
&
input
,
std
::
string
const
&
search
);
bool
ends_with
(
std
::
string
const
&
input
,
std
::
string
const
&
search
);
bool
contains
(
const
std
::
string
&
haystack
,
const
std
::
string
&
needle
);
inline
bool
contains
(
const
std
::
string
&
haystack
,
const
char
*
needle
)
{
return
contains
(
haystack
,
std
::
string
(
needle
));
}
inline
bool
contains
(
const
std
::
string
&
string
,
const
char
character
)
{
return
string
.
find
(
character
)
!=
std
::
string
::
npos
;
}
template
<
typename
IterT
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment