toTitleCase = string => {
  if (!string) return '';
  return string.replace(/\w\S*/g, txt => {
    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
  });
}
Convert the given string into title case format.
@param {String} string
@return {String} string