$mid( ) will work of course, but I think what he asked for was based on end position; therefore, I think that he wants $left( ) and $right( ), in this instance, because of the way he phrased his question.
%first should be the first 6 letters of "HELLOGUYS" (HELLOG)
- var %left = $left(HELLOGUYS, 6)
%last should be the last 6 letters of "HELLOGUYS"
- var %right = $right(HELLOGUYS, 6)
or all letters from the 4th letter of "HELLOGUYS"
- var %right = $right(HELLOGUYS, -3)
$right( , -3) because you're omitting the first 3 characters to start on the 4th.Using $mid:
var %first = $mid(HELLOGUYS, 1, 6)
var %last = $mid(HELLOGUYS, 4)