BUTFIRST word or list
BF word or list
BUTFIRST outputs all but the first element of its input. If its input is a list of words, BUTFIRST outputs a list of words containing all but the first word. If its input is a word or number, BUTFIRST outputs all the characters of the word or number except the first character.
? BUTFIRST [MARY HAD A LITTLE LAMB]
Result: [HAD A LITTLE LAMB]
? BUTFIRST "WHEAT
? BUTFIRST [WHEAT]
? BUTFIRST 2135
? BUTFIRST [[JANUARY FEBRUARY][MARCH APRIL] [MAY JUNE]]
Result: [[MARCH APRIL] [MAY JUNE]]
The following procedure removes one element at a time from a word or a list.
TO SHRINKWORD :WORD
IF EMPTY? :WORD THEN STOP
SHRINKWORD BUTFIRST :WORD
? SHRINKWORD "WHEAT