Extensions for kotlin.String

chomp

fun String.chomp(
    separator: String,
    onMissingDelimiter: () -> Pair<String, String>
): Pair<String, String>

Splits the given string into two parts before and after separator.

decodeBase64

fun String.decodeBase64(): String

decodeBase64Bytes

fun String.decodeBase64Bytes(): ByteArray

Decode String from base64 format

decodeBase64String

fun String.decodeBase64String(): String

Decode String from base64 format encoded in UTF-8.

encodeBase64

fun String.encodeBase64(): String

Encode String in base64 format and UTF-8 character encoding.

escapeHTML

fun String.escapeHTML(): String

Escapes the characters in a String using HTML entities

toCharArray

fun String.toCharArray(): CharArray

Convert String to CharArray