@Override
	public FieldElement substring(int start, int end) {
		IndexedOffset startPos = getIndexedOffsetForCharPosition(start);
		IndexedOffset endPos = getIndexedOffsetForCharPosition(end);

		// start and end are in the same attributed string
		if (startPos.index == endPos.index) {
			FieldElement asStart = fieldElements[startPos.index];
			return asStart.substring(startPos.offset, endPos.offset);
		}

		// 1) find the new start and end attributed strings
		FieldElement asStart = fieldElements[startPos.index];
		FieldElement newStart = asStart.substring(startPos.offset);
		FieldElement asEnd = fieldElements[endPos.index];
		FieldElement newEnd = asEnd.substring(0, endPos.offset);

		// 2) add the strings in between
		FieldElement[] newStrings = new FieldElement[(endPos.index - startPos.index) + 1];

		// copy into the second position until the second to last position, as the first and
		// last positions will be filled in later
		System.arraycopy(fieldElements, startPos.index + 1, newStrings, 1, newStrings.length - 1);

		// 3) add the new start and new end into the respective positions
		newStrings[0] = newStart;
		newStrings[newStrings.length - 1] = newEnd;
		return new CompositeFieldElement(newStrings);
	}
A FieldElement that is composed of other FieldElements.  The elements are laid out horizontally.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/CompositeFieldElement.java