そこらへんの関数は古いので実戦ではTPath使っとけ
http://docwiki.embarcadero.com/Libraries/Rio/ja/System.IOUtils.TPath.ChangeExtension