/kotlinext-string

Extensions of the Kotlin String class

Primary LanguageKotlinMIT LicenseMIT

Build Status codecov Codacy Badge Download License: MIT

kotlin-extension-string

This repository simply provides an artifact with additional String extension functions for the Kotlin String class.

Extension Functions

Currently, this artifact provides the following extension functions on the String class:

Function Description
ensureTrailing(Char) Ensures that the String ends with the specified Char, which is appended if necessary
ensureTrailingSlash() Ensures that the String ends with the '/' Char, which is appended if necessary.
containsWhitespace() Determines whether the String contains at least one whitespace Char using Unicode standard.

Install

Gradle

Add the following lines to your build.gradle

repositories {
    maven {
        url "https://dl.bintray.com/lukaszimmermann/lukaszimmermann"
    }
}

dependencies {
    implementation group: 'kotlinext', name: 'string', version: '3.0'
}

This will add the required Bintray repository and the dependency on this artifact.