aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/strings/str_util.h
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2017-05-09 09:54:58 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-05-10 16:33:35 -0700
commit2ca7c2bdc269b73803d6fa7c199667b987ebeb66 (patch)
tree829a1edd4b21d04964db8e5c903d983abebe5012 /tensorflow/core/lib/strings/str_util.h
parent73e537e7826297d2b238ca276db87f7289bb6eb2 (diff)
Add str_util::StringReplace.
PiperOrigin-RevId: 155516212
Diffstat (limited to 'tensorflow/core/lib/strings/str_util.h')
-rw-r--r--tensorflow/core/lib/strings/str_util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/lib/strings/str_util.h b/tensorflow/core/lib/strings/str_util.h
index bfecfef6cb..af24975ef4 100644
--- a/tensorflow/core/lib/strings/str_util.h
+++ b/tensorflow/core/lib/strings/str_util.h
@@ -85,6 +85,11 @@ string Uppercase(StringPiece s);
// set of characters that can be used as word boundaries.
void TitlecaseString(string* s, StringPiece delimiters);
+// Replaces the first occurrence (if replace_all is false) or all occurrences
+// (if replace_all is true) of oldsub in s with newsub.
+string StringReplace(StringPiece s, StringPiece oldsub, StringPiece newsub,
+ bool replace_all);
+
// Join functionality
template <typename T>
string Join(const T& s, const char* sep);