1 # define a variable containing a single space
3 space := $(blank) $(blank)
4 # split string $3 with $1 as separator and return the token in position $2
6 $(word $2, $(subst $1, ,$3))
8 # split string $3 with $1 as separator and reassemble it using the indexes in $2
10 $(subst $(space),$1,$(foreach i,$2,$(call token,$1,$i,$3)))