static String applyDiffs(String s, List<StringDiff> diffs) {

		if (diffs.isEmpty()) {
			return s;
		}

		if (diffs.get(0).start < 0) {
			// all replaced or all deleted
			String data = diffs.get(0).text;
			return data == null ? "" : data;
		}

		int pos = 0;
		StringBuilder buf = new StringBuilder(s.length());
		for (StringDiff element : diffs) {
			if (element.start > pos) {
				buf.append(s.substring(pos, element.start));
				pos = element.start;
			}

			String data = element.text;
			if (data != null) {
				buf.append(data);
			}
			else {
				// null data is a delete; move to the end of the delete
				pos = element.end;
			}
		}

		if (pos < s.length()) {
			buf.append(s.substring(pos));
		}
		return buf.toString();
	}
Applies the array of StringObjects to the string s to produce a new string. Warning - the
diff objects cannot be applied to an arbitrary string, the Strings must be the original
String used to compute the diffs.
@param s the original string
@param diffs the array of StringDiff object to apply
@return a new String resulting from applying the diffs to s.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/code/StringDiffUtils.java