Index: base/string_util.h |
=================================================================== |
--- base/string_util.h (revision 108864) |
+++ base/string_util.h (working copy) |
@@ -173,9 +173,9 @@ |
BASE_EXPORT extern const char kUtf8ByteOrderMark[]; |
-// Removes characters in |remove_chars| from anywhere in input. Returns true if |
-// any characters were removed. |remove_chars| must be null-terminated. |
-// NOTE: Safe to use the same variable for both input and output. |
+// Removes characters in |remove_chars| from anywhere in |input|. Returns true |
+// if any characters were removed. |remove_chars| must be null-terminated. |
+// NOTE: Safe to use the same variable for both |input| and |output|. |
BASE_EXPORT bool RemoveChars(const string16& input, |
const char16 remove_chars[], |
string16* output); |
@@ -183,9 +183,22 @@ |
const char remove_chars[], |
std::string* output); |
-// Removes characters in |trim_chars| from the beginning and end of input. |
+// Replaces characters in |replace_chars| from anywhere in |input| with |
+// |replace_with|. Returns true if any characters were removed. |
Mark Mentovai
2011/11/09 20:31:32
Removed? Replaced!
Mark Mentovai
2011/11/09 20:31:32
This doesn’t really explain whether ReplaceChars r
Alexei Svitkine (slow)
2011/11/09 21:03:58
Done.
Alexei Svitkine (slow)
2011/11/09 21:03:58
Done.
|
+// |replace_chars| must be null-terminated. |
+// NOTE: Safe to use the same variable for both |input| and |output|. |
+BASE_EXPORT bool ReplaceChars(const string16& input, |
+ const char16 replace_chars[], |
+ const string16& replace_with, |
+ string16* output); |
+BASE_EXPORT bool ReplaceChars(const std::string& input, |
+ const char replace_chars[], |
+ const std::string& replace_with, |
+ std::string* output); |
+ |
+// Removes characters in |trim_chars| from the beginning and end of |input|. |
// |trim_chars| must be null-terminated. |
-// NOTE: Safe to use the same variable for both input and output. |
+// NOTE: Safe to use the same variable for both |input| and |output|. |
BASE_EXPORT bool TrimString(const std::wstring& input, |
const wchar_t trim_chars[], |
std::wstring* output); |