public static String mergeStrings(String string1, String string2) {
		if (string1 == null && string2 == null) {
			return null; // Both strings are null;
		}
		boolean hasString1 = (string1 != null && !string1.equals(""));
		boolean hasString2 = (string2 != null && !string2.equals(""));

		if (hasString1) {
			if (hasString2) {
				int length1 = string1.length();
				int length2 = string2.length();
				boolean string1contains2 = (length2 <= length1) && string1.contains(string2);
				if (string1contains2) {
					return string1;
				}
				boolean string2contains1 = (length1 <= length2) && string2.contains(string1);
				if (string2contains1) {
					return string2;
				}
				// Different strings are defined, so merge them.
				return string1 + "\n" + string2;
			}
			return string1; // Only have string1.
		}
		if (hasString2) {
			return string2; // Only have string2.
		}
		return ""; // No strings but at least one empty string, so return empty string.
	}
Merge two strings into one. If one string contains the other, then the largest is returned.
If both strings are null then null is returned. If both strings are empty, the empty string
is returned. If the original two strings differ, this adds the second string to the first
separated by a newline.

@param string1 the first string
@param string2 the second string
@return the merged string
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java