private String trimNulls(String s) {
		int lastGoodChar = s.length() - 1;
		while (lastGoodChar >= 0 && s.charAt(lastGoodChar) == 0) {
			lastGoodChar--;
		}
		return s.substring(0, lastGoodChar + 1);
	}
Trims trailing nulls off the end of the string.

@param s String to trim
@return new String without any trailing null chars.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java