Kotlin Extension Functions for Java.
Implementation of kotlin extension methods for Java.
Currently in-progress:
- indices
- lastIndex
- all
- any
- asIterable
- asSequence
- byteInputStream
- capitalize
- chunked
- commonPrefixWith
- commonSuffixWith
- contains
- count
- decapitalize
- drop
- dropLast
- dropLastWhile
- dropWhile
- elementAtOrElse
- elementAtOrNull
- endsWith
- filter
- filterIndexed
- filterIndexedTo
- filterNot
- filterNotTo
- filterTo
- find
- findAnyOf
- findLast
- findLastAnyOf
- first
- firstOrNull
- flatMap
- flatMapTo
- fold
- foldIndexed
- foldRight
- foldRightIndexed
- forEach
- forEachIndexed
- getOrElse
- getOrNull
- groupBy
- groupByTo
- hasSurrogatePairAt
- ifBlank
- ifEmpty
- indexOf
- indexOfAny
- indexOfFirst
- indexOfLast
- isBlank
- isEmpty
- isNotBlank
- isNotEmpty
- isNullOrBlank
- isNullOrEmpty
- iterator
- last
- lastIndexOf
- lastIndexOfAny
- lastOrNull
- lines
- lineSequence
- map
- mapIndexed
- mapIndexedNotNull
- mapIndexedNotNullTo
- mapIndexedTo
- mapNotNull
- mapNotNullTo
- mapTo
- max
- maxBy
- maxWith
- min
- minBy
- minWith
- none
- onEach
- orEmpty
- padEnd
- padStart
- partition
- prependIndent
- random
- reader
- reduce
- reduceIndexed
- reduceRight
- reduceRightIndexed
- regionMatches
- removePrefix
- removeRange
- removeSuffix
- removeSurrounding
- replace
- replaceAfter
- replaceAfterLast
- replaceBefore
- replaceBeforeLast
- replaceFirst
- replaceIndent
- replaceIndentByMargin
- replaceRange
- reversed
- single
- singleOrNull
- slice
- split
- splitToSequence
- startsWith
- subSequence
- substring
- substringAfter
- substringAfterLast
- substringBefore
- substringBeforeLast
- sumBy
- sumByDouble
- take
- takeLast
- takeLastWhile
- takeWhile
- toBigDecimal
- toBigDecimalOrNull
- toBigInteger
- toBigIntegerOrNull
- toByteArray
- toByteOrNull
- toCharArray
- toCollection
- toHashSet
- toIntOrNull
- toList
- toLongOrNull
- toMutableList
- toPattern
- toRegex
- toSet
- toShortOrNull
- toSortedSet
- trim
- trimEnd
- trimIndent
- trimMargin
- trimStart
- windowed
- zip
- zipWithIndex
import static io.github.linktosriram.kext4j.text.StringUtils.*;
map("hello world", Character::toUpperCase); // [H, E, L, L, O, , W, O, R, L, D]
filter("Hello World", Character::isUpperCase); // "HW"
groupBy("Hello World", Character::isUpperCase); // {true=[H, W], false=[e, l, l, o, , o, r, l, d]}
This project is licensed under the MIT license. See the LICENSE file for more info.