public static int getIndent(String line) {
    int i = 0;
    while (i < line.length() && Character.isWhitespace(line.charAt(i))) i++;
    return i;
  }
Utility methods for text processing.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/util/TextUtil.java