public static String escape(char ch) {
    if (ch == '\\') return "\\\\";
    if (ch == '\t') return "\\t";
    if (ch == '\n') return "\\n";
    if (ch == '\b') return "\\b";
    if (ch == '\r') return "\\r";
    if (ch == '\f') return "\\f";
    return String.valueOf(ch);
  }
Returns the number of whitespace characters at the end of the given line.

@param line
@return
spock-core/src/main/java/org/spockframework/util/TextUtil.java