minLength

fun StringRuleBuilder.minLength(limit: Int, message: () -> String)

Validates that the string length is at least limit characters.

Usage:

rules<String> {
minLength(3) { "must be at least 3 characters" }
}

Parameters

limit

The minimum number of characters the string must have.

message

The message to return when the test fails.