summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/rtl/ustrbuf.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index a82a30b15995..25195f1434da 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -924,6 +924,26 @@ public:
return *this;
}
+ /**
+ Replace all occurrences of
+ oldChar in this string buffer with newChar.
+
+ @since LibreOffice 4.0
+
+ @param oldChar the old character.
+ @param newChar the new character.
+ @return this string buffer
+ */
+ OUStringBuffer& replace( sal_Unicode oldChar, sal_Unicode newChar )
+ {
+ sal_Int32 index = 0;
+ while((index = indexOf(oldChar, index)) >= 0)
+ {
+ pData->buffer[ index ] = newChar;
+ }
+ return *this;
+ }
+
/** Allows access to the internal data of this OUStringBuffer, for effective
manipulation.