help with String manipulation

I was hoping that there would be a straight forward solution like SlaveID=mid(cstring,0,3) - good old VB

There is the below.