public static String getLastWord(String s, String separator) {

		if (s == null) {
			return null;
		}

		String escaped = Pattern.quote(separator);
		String[] parts = s.split(escaped);
		String last = parts[parts.length - 1];
		return last;
	}
Takes a path-like string and retrieves the last non-empty item. Examples:
<ul>
<li>StringUtilities.getLastWord("/This/is/my/last/word/", "/") returns word</li>
<li>StringUtilities.getLastWord("/This/is/my/last/word/", "/") returns word</li>
<li>StringUtilities.getLastWord("This.is.my.last.word", ".") returns word</li>
<li>StringUtilities.getLastWord("/This/is/my/last/word/MyFile.java", ".") returns java</li>
<li>StringUtilities.getLastWord("/This/is/my/last/word/MyFile.java", "/") returns
MyFile.java</li>
</ul>

@param s the string from which to get the last word
@param separator the separator of words
@return the last word
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java