Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
common.h
Go to the documentation of this file.
1 
16 #pragma once
17 
18 namespace tc {
19 
20 std::string replaceString(
21  std::string str,
22  const std::string& search,
23  const std::string& replace) {
24  size_t pos = 0;
25  while ((pos = str.find(search, pos)) != std::string::npos) {
26  str.replace(pos, search.length(), replace);
27  pos += replace.length();
28  }
29  return str;
30 }
31 } // namespace tc
std::string replaceString(std::string str, const std::string &search, const std::string &replace)
Definition: common.h:20