General Utility Library for C++14  2.12
replace.h
Go to the documentation of this file.
1 
23 #ifndef GUL14_REPLACE_H_
24 #define GUL14_REPLACE_H_
25 
26 #include <string>
27 
28 #include "gul14/internal.h"
29 #include "gul14/string_view.h"
30 
31 namespace gul14 {
32 
49 GUL_EXPORT
50 std::string replace(string_view haystack, string_view needle, string_view hammer);
51 
64 GUL_EXPORT
65 std::string& replace_inplace(std::string& haystack, string_view needle, string_view hammer);
66 
68 
69 } // namespace gul14
70 
71 #endif
72 
73 /* vim:set noexpandtab softtabstop=4 tabstop=4 shiftwidth=4 textwidth=90 cindent: */
GUL_EXPORT std::string & replace_inplace(std::string &haystack, string_view needle, string_view hammer)
Replace all occurrences of a string within another string in-place.
Definition: replace.cc:53
GUL_EXPORT std::string replace(string_view haystack, string_view needle, string_view hammer)
Replace all occurrences of a string within another string, returning the result as a std::string.
Definition: replace.cc:29
basic_string_view< char > string_view
A view to a contiguous sequence of chars.
Definition: string_view.h:624
Definition of macros used internally by GUL.
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26
Provides a gul14::string_view that is fully compatible with C++17's std::string_view.