Cast input to a string.