-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplace_if.cpp
More file actions
36 lines (27 loc) · 777 Bytes
/
replace_if.cpp
File metadata and controls
36 lines (27 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* \file replace_if.cpp
* \brief
*
* \todo
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//-------------------------------------------------------------------------------------------------
bool
functor(const char a_it)
{
return !std::isalnum( static_cast<int>(a_it) );
}
//-------------------------------------------------------------------------------------------------
int main(int, char **)
{
std::string value = "Su tton (London,UK)";
value.erase(std::remove_if(value.begin(), value.end(), functor), value.end());
std::cout << STD_TRACE_VAR(value) << std::endl;
return 0;
}
//-------------------------------------------------------------------------------------------------
#if OUTPUT
value: SuttonLondonUK
#endif