yole
02/06/2016, 8:14 AMyole
02/06/2016, 8:15 AMyole
02/06/2016, 8:15 AMyole
02/06/2016, 8:21 AMvoddan
02/06/2016, 8:21 AMyole
02/06/2016, 8:22 AMyole
02/06/2016, 8:23 AMyole
02/06/2016, 8:23 AMyole
02/06/2016, 8:24 AMvoddan
02/06/2016, 9:38 AMvoddan
02/06/2016, 9:38 AMcedric
02/06/2016, 2:25 PMcedric
02/06/2016, 2:25 PMjkwatson
02/06/2016, 5:05 PMeric.kolotyluk
02/06/2016, 9:10 PMmikehearn
02/08/2016, 11:51 AMmikehearn
02/08/2016, 11:52 AMmikehearn
02/08/2016, 11:52 AMorangy
natpryce
02/08/2016, 1:28 PMmikehearn
02/08/2016, 2:53 PMmikehearn
02/08/2016, 2:53 PMEugenio
02/08/2016, 2:59 PMEugenio
02/08/2016, 3:00 PMorangy
vonox7
02/09/2016, 2:56 PM"string".count(predicate: (Char) -> Boolean): Int
method. But if my substring contains more than one character, this approach won't work. ApacheCommons offers a countMatches(str: CharSequence, sub: CharSequence): Int
method. It would be great to have an equivalent functionality in the Kotlin stdlib. Please correct me if the functionality is already given but i overlooked it. (see http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#countMatches(java.lang.CharSequence,%20java.lang.CharSequence) )cedric
02/09/2016, 3:23 PMcedric
02/09/2016, 3:23 PMcollection.sliding(3).filter { it = subString }
(approximate names)yole
02/09/2016, 3:24 PMvonox7
02/09/2016, 3:25 PMfun String.countMatches(sub: String): Int {
return (this.length - this.replace(sub, "").length) / sub.length;
}`