Skip to content
Utility extensions to boost your programming with Kotlin.
Branch: master
Clone or download
Latest commit 511d4ec May 13, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/me/carleslc/kotlin/extensions Update Mar 31, 2018
.gitignore Shaded Jar Mar 15, 2018
.project Maven project + Packages + More extensions Jul 2, 2017
LICENSE Initial commit Jun 26, 2017 Update May 13, 2019
pom.xml Update Mar 31, 2018


Utility extensions, properties and useful methods to boost your programming with Kotlin.


How to install


Add the following repository to your pom.xml:


Add the following dependencies to your pom.xml:


If you need more powerful extensions and tools check the optional libraries section.


Add the following repository to your build.gradle:

repositories {
    maven { url '' }

Add the following dependency to your build.gradle:

dependencies {
    compile 'com.github.carleslc:kotlin-extensions:0.7.6'

If you need more powerful extensions and tools check the optional libraries section.


  1. git clone
  2. cd kotlin-extensions
  3. Build the KotlinExtensions with mvn clean install. This also adds this project to your local Maven repository.

If you wish, you can use these steps to add the dependency using Maven or Gradle without accessing to the remote repository.

Otherwise you will need to add the kotlin-extensions-0.7.6.jar from generated target folder as external dependency of your project.

If you need more powerful extensions and tools check the optional libraries section.

How to use

In order to use any of the extensions or methods of KotlinExtensions you only need to import them.

Import a single extension

import me.carleslc.kotlin.extensions.standard.times

Import all extensions of a package

import me.carleslc.kotlin.extensions.standard.*

Packages available


import me.carleslc.kotlin.extensions.arrays.*

Extensions for arrays, a syntactic-sugar way to create literal arrays like A[1, 2, 3] instead typical arrayOf(1, 2, 3) and methods to work with 2D arrays and matrices (2D arrays with fixed columns size) easier.


import me.carleslc.kotlin.extensions.bytes.*

Extensions for memory size conversions (from bits to pebibytes and petabytes).

Inspired from ktunits library.


import me.carleslc.kotlin.extensions.collections.*

Extensions for collections, sintactic-sugar for list and set literals with L[values] or S[values] and other global methods to create collections.


import me.carleslc.kotlin.extensions.conversions.*

Extensions for conversions between basic types.


import me.carleslc.kotlin.extensions.html.*

Extensions to generate HTML in a more readable way.



Extensions for maps and sintactic-sugar for Map literals with M[pairs].


import me.carleslc.kotlin.extensions.number.*

Extensions for numbers and math operations.


import me.carleslc.kotlin.extensions.strings.*

Extensions for strings.

pluralize and singularize methods are extracted from kotlin-pluralizer.


import me.carleslc.kotlin.extensions.time.*

Extensions for timing, format and manage time or dates easily.

Inspired from kxdate and khronos libraries.


import me.carleslc.kotlin.extensions.tuples.*

Extensions for pairs and triples.


import me.carleslc.kotlin.extensions.preconditions.*

Extensions to ensure preconditions easily.


import me.carleslc.kotlin.extensions.standard.*

General purpose extensions and global methods that do not match any other package category (e.g. looping with 10 times { code } or 10 * { code }).


Do you want to contribute to this project? Great!

Simply fork and do a pull request. Then if it makes sense I will merge it creating a new version of this project.

Follow this rules when doing a pull request in order to be accepted:

  1. Match the code style of this project (default in IntelliJ). You can do ⌘ + Option + L in Mac with IntelliJ IDE to reformat your code.
  2. Unit Test your code.
  3. Inline your extensions when possible. Include @file:Suppress("NOTHING_TO_INLINE") to suppress warnings at top of your file.
  4. Ensure that your extensions/methods are general enough to be used in many different contexts.
  5. Be descriptive in the title and description of your pull request.

Optional Libraries


This library adds functional stuff to boost your programming with Kotlin. It is a perfect library to use together with KotlinExtensions. We've already included arrow.core, and arrow.syntax in KotlinExtensions.


This library from Google includes a lot of useful classes and methods to extend the language. It is written in Java but it can be used from Kotlin with no problem.

It is already included with version 23.3-android in KotlinExtensions, available for Android use.


If you need extensions and useful tools for Android this library is a must for your Android development.

You can’t perform that action at this time.