FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithm-examples/cpp-algorithm/src/array/replace_element.h at main · codejsha/algorithm-examples · GitHub
codejsha
/
algorithm-examples
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
algorithm-examples
/
cpp-algorithm
/
src
/
array
/
replace_element.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (38 loc) · 1.42 KB
Breadcrumbs
algorithm-examples
/
cpp-algorithm
/
src
/
array
/
replace_element.h
Copy path
File metadata and controls
43 lines (38 loc) · 1.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
37
38
39
40
41
42
43
#
ifndef
CPP_ALGORITHM_REPLACE_ELEMENT_H
#
define
CPP_ALGORITHM_REPLACE_ELEMENT_H
#
include
<
string
>
#
include
<
vector
>
namespace
ReplaceElement
{
/*
*
* \brief Replace element and remove element in the array. Keep the array size.
* \param arr input array
* \param replace_str replace string
* \param remove_str remove string
* \return result array
*/
auto
ReplaceAndRemoveString1
(std::vector<std::string>& arr,
const
std::string& replace_str,
const
std::string& remove_str)
-> std::vector<std::string>;
/*
*
* \brief Replace element and remove element in the array.
* Use some STL algorithms.
* \param arr input array
* \param replace_str replace string
* \param remove_str remove string
* \return result array
*/
auto
ReplaceAndRemoveString2
(std::vector<std::string>& arr,
const
std::string& replace_str,
const
std::string& remove_str)
-> std::vector<std::string>;
/*
*
* \brief Telex encoding for punctuation marks.
* Replace '.' with 'DOT', ',' with 'COMMA', '?' with 'QUESTION_MARK', '!' with 'EXCLAMATION_MARK'.
* \param arr input array (possibly contains punctuation marks)
* \return result array
*/
auto
TelexEncoding
(std::vector<std::string>& arr) -> std::vector<std::string>;
}
#
endif
Back
|
FazBrowse Home
|
New Git URL