Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: base/string_util.h

Issue 18603: Add a replace_all param to ReplaceSubstringsAfterOffset and update call sites. (Closed)
Patch Set: Add ReplaceFirstSubstringAfterPos() Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.h
diff --git a/base/string_util.h b/base/string_util.h
index 601d1d87398e3317fe7a938951ff76666408e02b..6d7ff94affaf5634450d511233c94eef0a81d856 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -320,6 +320,17 @@ std::wstring FormatSpeed(int64 bytes, DataUnits units, bool show_units);
// Ex: FormatNumber(1234567) => 1,234,567
std::wstring FormatNumber(int64 number);
+// Starting at |start_offset| (usually 0), replace the first instance of
+// |find_this| with |replace_with|.
+void ReplaceFirstSubstringAfterOffset(std::wstring* str,
+ std::wstring::size_type start_offset,
+ const std::wstring& find_this,
+ const std::wstring& replace_with);
+void ReplaceFirstSubstringAfterOffset(std::string* str,
+ std::string::size_type start_offset,
+ const std::string& find_this,
+ const std::string& replace_with);
+
// Starting at |start_offset| (usually 0), look through |str| and replace all
// instances of |find_this| with |replace_with|.
//
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698