Cut first x chars and last x chars from string

I’m sure this question was asked before, but i didn’t found it in the search results:

How can i cut the first 256 chars and the last 256 chars from a string, so that only the middle part remains?

Something like this ?

Dim longStr As String //This is the string you want to cut

Dim cutStr As String

cutStr = longStr.mid(257, len(longStr)-512)[/code]

Thank you,

this is what i was looking for.