Complex sentence: Between 1918 and 1940 it was almost entirely in Greater Romania, while prior to that it served as a border between Romania and the Russian Empire.
Split into simpler sentences: Between 1918 and 1940 it was almost entirely in Greater Romania. While prior to that it also served as a border between Romania and the Russian Empire.