public static int getWhitespacePrefixLength(@Nonnull String text, int tabWidth) {
		char[] chars = text.toCharArray();
		int offset = 0;
		for (char c : chars) {
			if (c == ' ' || c == '\t') offset++;
			else break;
		}
		return getTabAdjustedLength(text.substring(0, offset), tabWidth);
	}
@param text
		Text to scan prefix of.
@param tabWidth
		Width of spaces to translate tab characters to.

@return Number of blank spaces until some non-whitespace char is found.
recaf-core/src/main/java/software/coley/recaf/util/StringUtil.java