Format a string, using values from an object.