diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 02:02:14 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 02:02:52 -0500 |
commit | e786e2d25ab0105e88d7ca260c7ef4a88c9b821c (patch) | |
tree | cbeab4b56c87f944d095f1c2347b4752527ed5c1 /comphelper/source/misc | |
parent | 35054d3f6213c11546200820c706c8a1527ec605 (diff) |
String to rtl::OUString.
Diffstat (limited to 'comphelper/source/misc')
-rw-r--r-- | comphelper/source/misc/string.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 873a1ffe34e9..6f59564814b9 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -235,6 +235,18 @@ sal_uInt32 decimalStringToNumber( return result; } +rtl::OUString removeTrailingChars(const rtl::OUString& rStr, sal_Unicode cChar) +{ + sal_Int32 n = rStr.getLength(); + const sal_Unicode* p = &rStr.getStr()[n-1]; // last char + while (n > 0 && *p == cChar) + { + --p; + --n; + } + return rStr.copy(0, n); +} + using namespace ::com::sun::star; // convert between sequence of string and comma separated string |