public static String convertTabsToSpaces(String str, int tabSize) {
		if (str == null) {
			return null;
		}

		StringBuffer buffer = new StringBuffer();

		int linepos = 0;

		for (int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if (c == '\t') {
				int nSpaces = tabSize - (linepos % tabSize);
				String pad = pad("", ' ', nSpaces);
				buffer.append(pad);
				linepos += nSpaces;
			}
			else {
				buffer.append(c);
				linepos++;
				if (c == '\n') {
					linepos = 0;
				}
			}
		}

		return buffer.toString();
	}
Convert tabs in the given string to spaces.

@param str string containing tabs
@param tabSize length of the tab
@return string that has spaces for tabs
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java