| 1 |
|
|---|
| 2 | #include <iostream>
|
|---|
| 3 | #include <boost/algorithm/string.hpp>
|
|---|
| 4 | #include <boost/algorithm/string/trim_all.hpp>
|
|---|
| 5 |
|
|---|
| 6 | using namespace std;
|
|---|
| 7 | using namespace boost;
|
|---|
| 8 |
|
|---|
| 9 | int main()
|
|---|
| 10 | {
|
|---|
| 11 | string test_sequence("TEST_**???***_TEST");
|
|---|
| 12 | cout << "test_sequence: " << test_sequence << endl;
|
|---|
| 13 |
|
|---|
| 14 | string trimmed1 = trim_all_copy_if(test_sequence, is_any_of("\\/:*?\"<>|"));
|
|---|
| 15 | cout << "trim_all_copy_if(): " << trimmed1 << endl;
|
|---|
| 16 |
|
|---|
| 17 | string trimmed2 = trim_all_copy_if(test_sequence, is_any_of("\\/:\\*?\"<>|"));
|
|---|
| 18 | cout << "trim_all_copy_if(): " << trimmed2 << endl;
|
|---|
| 19 |
|
|---|
| 20 | string trimmed3 = trim_fill_copy_if(test_sequence, "", is_any_of("\\/:*?\"<>|"));
|
|---|
| 21 | cout << "trim_fill_copy_if(,\"=\"): " << trimmed3 << endl;
|
|---|
| 22 |
|
|---|
| 23 | return 0;
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|