I've been searching online. Is there a way to cut off the space and the rest of the filename but leave the extension with VBScript.

Say I have a filename like this:

```
filename this is a file.txt

```

Could VBScript cut off the space and everything afterwards but leave the extension like this:

```
filename.txt

```