So I have been trying to take off a timestamp from a string, a file name to be more specific.

I tried making a substring, but the size of the timestamp is variable.

For example, sometimes it's like this:

```
2016-05-05 03:45:00.907text.txt

```

and sometimes like this:

```
2016-05-05 03:45:00.83text.txt

```

Maybe regex is the answer?

The string to be processed will always have a timestamp plus a filename. The filename can start with numbers or letters.

I forgot to say it's for Java.