summaryrefslogtreecommitdiff
path: root/l10ntools/source/helper.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'l10ntools/source/helper.hxx')
-rw-r--r--l10ntools/source/helper.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/l10ntools/source/helper.hxx b/l10ntools/source/helper.hxx
index 48f74a53541b..b2ff952a675a 100644
--- a/l10ntools/source/helper.hxx
+++ b/l10ntools/source/helper.hxx
@@ -87,6 +87,18 @@ inline bool endsWithAsciiL(
search, searchLength, text.getLength() - searchLength);
}
+inline sal_Int32 countOccurrences(rtl::OString const & text, char c) {
+ sal_Int32 n = 0;
+ for (sal_Int32 i = 0;; ++i) {
+ i = text.indexOf(c, i);
+ if (i == -1) {
+ break;
+ }
+ ++n;
+ }
+ return n;
+}
+
inline rtl::OString trimAscii(rtl::OString const & text) {
sal_Int32 i1 = 0;
while (i1 != text.getLength() && isAsciiWhitespace(text[i1])) {