function formatString(format, tokens) {
  var values = [];

  if(_.isArray(tokens) || _.isObject(tokens)) {
    values = tokens;
  } else {
    values = _.takeRight(arguments, arguments.length - 1);
  }

  _.forEach(values, function(value, key) {
    format = _.replace(format, '{' + key + '}', _.isUndefined(value) ? '' : _.toString(value));
  });

  return format;
}
Replaces matching index tokens with value from arguments or array.

@static
@memberOf _
@param {string} format - The string with replacement tokens.
@param {...string | string[] | object} tokens - The data used for the tokens to populate the format string.
@returns {string} The string with replaced tokens.
@example
_.formatString('Hallo {0}!', 'Welt') => 'Hallo Welt!'