1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Fix compiling messages.

This commit is contained in:
Cedric Beust 2016-04-01 05:33:02 -08:00
parent 2e58afa75c
commit c6f9c88d2a
3 changed files with 8 additions and 7 deletions

View file

@ -2,9 +2,10 @@ package com.beust.kobalt.misc
import com.google.common.base.CharMatcher
public class Strings {
class Strings {
companion object {
fun pluralize(s: String, n: Int) = s + (if (n != 1) "s" else "")
fun pluralizeAll(s: String, n: Int) = "$n " + pluralize(s, n)
}
}
@ -12,6 +13,6 @@ public class Strings {
/**
* @Return the number of times the given character occurs in the string
*/
public infix fun String.countChar(c: Char) : Int {
infix fun String.countChar(c: Char) : Int {
return CharMatcher.`is`(c).countIn(this)
}