erikjung
2/22/2016 - 7:17 PM

toTitle

toTitle

const toTitle = str => {
  return str.split(/[\W_]+/)
    .map(word => word.replace(/^\w/, first => first.toUpperCase()))
    .join(' ')
}