Is only blank


Definition

Return true if a string contain space or is empty.

Usage

addRule("field -> blank")

Tests

@Test
public final void testRuleBlankOk() throws Exception {
    UtilTest.testIt("blank", "  ", true);
    UtilTest.testIt("blank", "", true);
    UtilTest.testIt("blank", "             ", true);
    UtilTest.testIt("blank", "   ", true);
}

@Test
public final void testRuleBlankNotOk() throws Exception {
    UtilTest.testIt("blank", "a", false);
    UtilTest.testIt("blank", ". ", false);
    UtilTest.testIt("blank", "   - ", false);
}

results matching ""

    No results matching ""