hexagon logo

Extract numbers from variable

I have a variable V1=Z12345-123, is there any way I can assign V2= (the first 6 characters of V1) = Z12345