I am trying to split the string with python code with following output:

```
import os

f = "Retirement-User-Portfolio-DEV-2020-7-29.xml"

to_output = os.path.splitext(f)[0]
print(to_output)

```

I have received an output :

```
Retirement-User-Portfolio-DEV-2020-7-29

```

However, I want the output like this below and remove "-DEV-2020-7-29" FROM THE STRING:

```
Retirement-User-Portfolio

```