uses StrUtils; ... CopyStart:=Pos('/',str); CopyEnd:=PosEx('/', str, CopyStart+1); S := Copy(str, CopyStart+1, CopyEnd-CopyStart-1);