summaryrefslogtreecommitdiffstats
path: root/python/mozlint/mozlint/util/string.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/mozlint/mozlint/util/string.py')
-rw-r--r--python/mozlint/mozlint/util/string.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/mozlint/mozlint/util/string.py b/python/mozlint/mozlint/util/string.py
new file mode 100644
index 0000000000..9c1c7c99c2
--- /dev/null
+++ b/python/mozlint/mozlint/util/string.py
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+def pluralize(s, num):
+ if num != 1:
+ s += "s"
+ return str(num) + " " + s