Refactor string.c

It is unnecessary to assign variables.