Extensions

object Extensions

Collection of handy extensions used throughout the library.

Functions

Link copied to clipboard
fun String.letterify(random: Random = Random.Default, upper: Boolean = true): String

Replaces every ? char for this String receiver with a random upper-case letter from the English alphabet and returns the modified String.

Link copied to clipboard
fun <T, TT> Generator<T>.mutate(mut: Mutator<T, TT>): Generator<TT>

Allows for a Mutator to be applied directly to a given Generator

Link copied to clipboard
fun <T> List<T>.nextItem(random: Random = Random.Default): T

Returns a random element of a list

Link copied to clipboard
fun Random.nextLetter(upper: Boolean): Char

Returns a random letter from Alphabet.source

Link copied to clipboard
fun String.numerify(random: Random = Random.Default): String

Replaces every # char for this String receiver with a random int from 0 to 9 inclusive and returns the modified String.